$sjId, 'time' => $today]); } public static function checkUp($id, $sjId) { $stat = self::getById($id, true); if ($stat->sjId != $sjId) { util::fail('你没有权限'); } if ($stat->checkUp == 1) { util::fail('你已经对过帐了'); } $stat->checkUp = 1; $stat->save(); return true; } //获取最近的收入情况 ssh 2019.9.21 public static function getLatestIncome($start, $end, $sjId) { $list = self::getAllList('*', ['sjId' => $sjId, 'time' => ['between', [$start, $end]]], 'time asc'); return $list; } //最近7天收入情况 ssh 2020.2.2 public static function getLatestSevenDay($sjId) { $return = dateUtil::getDate(1); $start = $return[0]; $end = $return[1]; $list = self::getLatestIncome($start, $end, $sjId); $data = []; if (!empty($list)) { foreach ($list as $key => $val) { $date = $val['time']; $income = $val['amount']; $data[$date] = $income; } } return $data; } }