update
This commit is contained in:
parent
2d683824b0
commit
7a8cf5f7bd
@ -11,68 +11,70 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | author: likeadminTeam
|
// | author: likeadminTeam
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace app\adminapi\lists\dept;
|
namespace app\adminapi\lists\dept;
|
||||||
|
|
||||||
|
|
||||||
use app\adminapi\lists\BaseAdminDataLists;
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
use app\common\model\dept\Orgs;
|
use app\common\lists\ListsSearchInterface;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\model\dept\Orgs;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Orgs列表
|
* Orgs列表
|
||||||
* Class OrgsLists
|
* Class OrgsLists
|
||||||
* @package app\adminapi\lists
|
* @package app\adminapi\lists
|
||||||
*/
|
*/
|
||||||
class OrgsLists extends BaseAdminDataLists implements ListsSearchInterface
|
class OrgsLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 设置搜索条件
|
* @notes 设置搜索条件
|
||||||
* @return \string[][]
|
* @return \string[][]
|
||||||
* @author likeadmin
|
* @author likeadmin
|
||||||
* @date 2023/12/09 10:55
|
* @date 2023/12/09 10:55
|
||||||
*/
|
*/
|
||||||
public function setSearch(): array
|
public function setSearch(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'=' => ['status'],
|
'=' => ['status'],
|
||||||
'%like%' => ['name', 'master'],
|
'%like%' => ['name', 'master'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 获取列表
|
* @notes 获取列表
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\DbException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
* @author likeadmin
|
* @author likeadmin
|
||||||
* @date 2023/12/09 10:55
|
* @date 2023/12/09 10:55
|
||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return Orgs::where($this->searchWhere)
|
return Orgs::where($this->searchWhere)
|
||||||
->field(['id', 'name', 'master', 'status','create_time'])
|
->field(['id', 'name', 'master', 'status', 'create_time'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()
|
->select()->each(function ($data) {
|
||||||
->toArray();
|
$data['status_text'] = $data->status_text;
|
||||||
}
|
})
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @notes 获取数量
|
|
||||||
* @return int
|
/**
|
||||||
* @author likeadmin
|
* @notes 获取数量
|
||||||
* @date 2023/12/09 10:55
|
* @return int
|
||||||
*/
|
* @author likeadmin
|
||||||
public function count(): int
|
* @date 2023/12/09 10:55
|
||||||
{
|
*/
|
||||||
return Orgs::where($this->searchWhere)->count();
|
public function count(): int
|
||||||
}
|
{
|
||||||
|
return Orgs::where($this->searchWhere)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user