| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\workerapi\lists;
- use app\common\lists\ListsSearchInterface;
- use app\common\model\training\TrainingCourse;
- use app\common\model\training\TrainingWorkerCourse;
- use DateTime;
- /**
- * TrainingWorkerCourseLists列表
- * Class TrainingWorkerCourseLists
- * @package app\workerapi\listsworks
- */
- class TrainingCourseLists extends BaseWorkerDataLists
- {
- public function queryWhere(){
- $where = [];
- $where[] = ['course_lock','=',1];
- return $where;
- }
- /**
- * @notes 获取列表
- */
- public function lists(): array
- {
- return TrainingCourse::where($this->queryWhere())
- ->field('*')
- ->limit($this->limitOffset, $this->limitLength)
- ->order(['create_time' => 'desc'])
- ->select()
- ->toArray();
- }
- /**
- * @notes 获取数量
- * @return int
- * @author whitef
- * @date 2024/07/10 15:06
- */
- public function count(): int
- {
- return TrainingCourse::where($this->queryWhere())->count();
- }
- }
|