47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
![]() |
<?php
|
||
|
|
||
|
namespace app\adminapi\lists\approve;
|
||
|
|
||
|
use app\adminapi\lists\BaseAdminDataLists;
|
||
|
use app\common\lists\ListsSearchInterface;
|
||
|
use app\common\model\Approve;
|
||
|
|
||
|
class ApproveLists extends BaseAdminDataLists implements ListsSearchInterface
|
||
|
{
|
||
|
/**
|
||
|
* @notes 设置搜索条件
|
||
|
* @return \string[][]
|
||
|
* @author likeadmin
|
||
|
* @date 2023/08/31 11:08
|
||
|
*/
|
||
|
public function setSearch(): array
|
||
|
{
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
|
||
|
public function queryWhere()
|
||
|
{
|
||
|
$where = [];
|
||
|
// $where[] = ['check_admin_ids', '=', $this->adminId]; // todo 放开过滤条件,只有片区经理才能查看
|
||
|
return $where;
|
||
|
}
|
||
|
|
||
|
public function lists(): array
|
||
|
{
|
||
|
return Approve::where($this->searchWhere)
|
||
|
->where($this->queryWhere())
|
||
|
->with('task')
|
||
|
->field('*')
|
||
|
->limit($this->limitOffset, $this->limitLength)
|
||
|
->order(['id' => 'desc'])
|
||
|
->select()
|
||
|
->toArray();
|
||
|
}
|
||
|
|
||
|
|
||
|
public function count(): int
|
||
|
{
|
||
|
return Approve::where($this->searchWhere)->count();
|
||
|
}
|
||
|
}
|