erp_old/app/admin/lists/bank/BankLists.php
2024-05-13 16:03:16 +08:00

65 lines
1.3 KiB
PHP

<?php
namespace app\admin\lists\bank;
use app\admin\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\bank\Bank;
/**
* Bank列表
* Class BankLists
* @package app\admin\listsbank
*/
class BankLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2024/05/13 11:09
*/
public function setSearch(): array
{
return [
'%like%' => ['name'],
];
}
/**
* @notes 获取列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2024/05/13 11:09
*/
public function lists(): array
{
return Bank::where($this->searchWhere)
->field(['id', 'name', 'image'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取数量
* @return int
* @author likeadmin
* @date 2024/05/13 11:09
*/
public function count(): int
{
return Bank::where($this->searchWhere)->count();
}
}