fetch(); } public function getAwardHistory() { $where = UtilService::getMore([ ['page', 1], ['limit', 20], ['activity', ''], ['period', ''], ]); $model = SystemAwardHistoryModel::page(intval($where['page']), intval($where['limit'])); if ($where['activity']) { $model = $model->where('activity', $where['activity']); } if ($where['period']) { list($startTime, $endTime) = explode(' - ', $where['period']); $model = $model->where('ts', '>', strtotime($startTime)); $model = $model->where('ts', '<', strtotime($endTime) + 24 * 3600); } $list = $model->field('*, FROM_UNIXTIME(ts, "%Y-%m-%d %H:%i:%s") as stime')->order('ts desc')->select(); $count = $model->count(); return Json::successlayui(['count'=>$count, 'data'=>$list]); } }