join('ll_scene ls', 'ls.id = la.scene_id') ->where($this->searchWhere) ->whereIn('la.status', [1, 2, 3]) ->where('la.user_id', $this->userId) ->field('la.id, la.scene_id, la.total_score, la.task_id, ls.name as scene_name, ls.logo as scene_logo, la.remark, la.start_time, la.end_time, la.status') ->order('la.id', 'desc') ->limit($this->limitOffset, $this->limitLength) ->select() ->each(function ($item) { $item['scene_logo'] = $item['scene_logo'] ? FileService::getFileUrl($item['scene_logo']) : ''; //时长 end_time - start_time $item['duration'] = $item['end_time'] - $item['start_time']; $item['start_time'] = date('Y-m-d H:i:s', $item['start_time']); $item['end_time'] = date('Y-m-d H:i:s', $item['end_time']); }) ->toArray(); } /** * @notes 统计 * @return int * @author L * @date 2024-07-05 11:05:46 */ public function count(): int { return LlAnalysis::alias('la') ->join('ll_scene ls', 'ls.id = la.scene_id') ->where($this->searchWhere) ->whereIn('la.status', [1, 2, 3]) ->where('la.user_id', $this->userId) ->count(); } /** * @notes 搜索条件 * @return array * @author L * @date 2024-07-05 11:05:46 */ public function setSearch(): array { return []; } }