65 lines
1.5 KiB
PHP
65 lines
1.5 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/23 15:56
|
|
*/
|
|
public function setSearch(): array
|
|
{
|
|
return [
|
|
'=' => ['name', 'tel', 'supplier_type', 'invoice_type'],
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取供应商管理列表
|
|
* @return array
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
* @author likeadmin
|
|
* @date 2024/04/23 15:56
|
|
*/
|
|
public function lists(): array
|
|
{
|
|
return Supplier::where($this->searchWhere)
|
|
->field(['id', 'name', 'py', 'number', 'uid', 'contacts', 'tel', 'bank', 'account', 'tax', 'supplier_type', 'tax_rate', 'invoice_type', 'dept_type'])
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->order(['id' => 'desc'])
|
|
->select()
|
|
->toArray();
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取供应商管理数量
|
|
* @return int
|
|
* @author likeadmin
|
|
* @date 2024/04/23 15:56
|
|
*/
|
|
public function count(): int
|
|
{
|
|
return Supplier::where($this->searchWhere)->count();
|
|
}
|
|
|
|
} |