erp/app/admin/lists/supplier/SupplierLists.php
2024-04-29 16:36:12 +08:00

65 lines
1.6 KiB
PHP

<?php
namespace app\admin\lists\supplier;
use app\admin\lists\BaseAdminDataLists;
use app\common\model\supplier\Supplier;
use app\common\lists\ListsSearchInterface;
/**
* 供应商管理列表
* Class SupplierLists
* @package app\admin\listssupplier
*/
class SupplierLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2024/04/27 14:33
*/
public function setSearch(): array
{
return [
'=' => ['category_id', 'type_id', 'mer_name'],
];
}
/**
* @notes 获取供应商管理列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2024/04/27 14:33
*/
public function lists(): array
{
return Supplier::where($this->searchWhere)
->field(['id', 'category_id', 'type_id', 'mer_name', 'settle_cycle', 'interest_rate', 'sys_labels', 'mer_address', 'status', 'commission_rate', 'commission_switch', 'mer_money'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取供应商管理数量
* @return int
* @author likeadmin
* @date 2024/04/27 14:33
*/
public function count(): int
{
return Supplier::where($this->searchWhere)->count();
}
}