25 lines
768 B
PHP
25 lines
768 B
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\common\model\task\Task;
|
|
|
|
class TaskController extends BaseApiController{
|
|
|
|
public function lists(){
|
|
$param = Request()->param();
|
|
[$page, $limit] = $this->getPage();
|
|
if($this->userInfo['admin_id']!=00){
|
|
$where[]=['company_id','=',$this->userInfo['company_id']];
|
|
}else{
|
|
return $this->fail('你没有权限访问');
|
|
}
|
|
$res=Task::where($where)
|
|
->field(['id', 'title', 'template_id','director_uid', 'company_id', 'start_time', 'end_time', 'director_uid', 'type', 'status', 'content','extend'])
|
|
->page($page,25)
|
|
->order(['id' => 'desc'])
|
|
->select()
|
|
->toArray();
|
|
return $this->success('ok', $res);
|
|
}
|
|
} |