['name'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2023/2/23 18:43 */ public function lists(): array { $lists = InterviewJob::where($this->searchWhere) ->where('user_id', '=', $this->userId) ->order('id', 'desc') ->select() ->each(function ($item) { $item['tips'] = json_decode($item['tips']); }) ->toArray(); foreach ($lists as &$item){ $item['interview_user_num'] = Interview::where(['job_id' => $item['id']])->count(); $config = InterviewConfig::where('job_id', $item['id'])->findOrEmpty()->toArray(); $item['interview_config'] = $config; } return $lists; } /** * @notes 获取数量 * @return int * @author 段誉 * @date 2023/2/23 18:43 */ public function count(): int { return InterviewJob::where($this->searchWhere)->where('user_id', '=', $this->userId)->count(); } }