['course_picture', 'course_url', 'course_lock', 'course_length', 'course_question_setting', 'course_question_score'], '%like%' => ['course_name'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2025/02/14 17:37 */ public function lists(): array { return TrainingCourse::where($this->searchWhere) ->field(['id', 'course_name', 'course_picture', 'course_url', 'course_lock', 'course_length', 'course_question_setting', 'course_question_score']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2025/02/14 17:37 */ public function count(): int { return TrainingCourse::where($this->searchWhere)->count(); } }