fix(order): 修复订单中的错误 refactor(order): 重构订单代码,优化结构 style(order): 优化订单代码风格 test(order): 为订单添加测试 docs(order): 更新订单相关文档 build(order): 更新订单依赖 ops(order): 更新订单基础设施 chore(order): 更新订单 .gitignore
65 lines
1.4 KiB
PHP
65 lines
1.4 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 admin
|
|
* @date 2024/08/15 14:10
|
|
*/
|
|
public function setSearch(): array
|
|
{
|
|
return [
|
|
'=' => ['mer_name', 'phone'],
|
|
];
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取供应链列表
|
|
* @return array
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
* @author admin
|
|
* @date 2024/08/15 14:10
|
|
*/
|
|
public function lists(): array
|
|
{
|
|
return Supplier::where($this->searchWhere)
|
|
->field(['id', 'category_id', 'mer_name', 'phone', 'settle_cycle', 'address', 'mark'])
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
->order(['id' => 'desc'])
|
|
->select()
|
|
->toArray();
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取供应链数量
|
|
* @return int
|
|
* @author admin
|
|
* @date 2024/08/15 14:10
|
|
*/
|
|
public function count(): int
|
|
{
|
|
return Supplier::where($this->searchWhere)->count();
|
|
}
|
|
|
|
} |