pushCriteria(app(RequestCriteria::class)); } //获取最近刷新时间 public function getLastRefreshDate($where) { return $this->model->where($where)->select(['created_at'])->orderBy('created_at', 'desc')->first(); } public function getTodayRefreshTimes($where) { $today = strtotime(date('Y-m-d')); $tomorrow = $today+3600*24; $data =[ ['created_at','>=',date('Y-m-d H:i:s', $today)], ['created_at','<', date('Y-m-d H:i:s', $tomorrow)] ]; return $this->model->where($where)->where($data)->count(); } public function addLog($data) { return $this->model->create($data); } }