65 lines
1.5 KiB
PHP
65 lines
1.5 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace app\admin\lists\delivery_service;
|
||
|
|
||
|
|
||
|
use app\admin\lists\BaseAdminDataLists;
|
||
|
use app\common\model\delivery_service\DeliveryService;
|
||
|
use app\common\lists\ListsSearchInterface;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 配送员列表
|
||
|
* Class DeliveryServiceLists
|
||
|
* @package app\admin\listsdelivery_service
|
||
|
*/
|
||
|
class DeliveryServiceLists extends BaseAdminDataLists implements ListsSearchInterface
|
||
|
{
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 设置搜索条件
|
||
|
* @return \string[][]
|
||
|
* @author admin
|
||
|
* @date 2024/08/08 14:07
|
||
|
*/
|
||
|
public function setSearch(): array
|
||
|
{
|
||
|
return [
|
||
|
'=' => ['uid', 'nickname', 'phone', 'status','type'],
|
||
|
];
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 获取配送员列表
|
||
|
* @return array
|
||
|
* @throws \think\db\exception\DataNotFoundException
|
||
|
* @throws \think\db\exception\DbException
|
||
|
* @throws \think\db\exception\ModelNotFoundException
|
||
|
* @author admin
|
||
|
* @date 2024/08/08 14:07
|
||
|
*/
|
||
|
public function lists(): array
|
||
|
{
|
||
|
return DeliveryService::where($this->searchWhere)
|
||
|
->field(['id', 'uid', 'nickname', 'phone', 'status'])
|
||
|
->limit($this->limitOffset, $this->limitLength)
|
||
|
->order(['id' => 'desc'])
|
||
|
->select()
|
||
|
->toArray();
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 获取配送员数量
|
||
|
* @return int
|
||
|
* @author admin
|
||
|
* @date 2024/08/08 14:07
|
||
|
*/
|
||
|
public function count(): int
|
||
|
{
|
||
|
return DeliveryService::where($this->searchWhere)->count();
|
||
|
}
|
||
|
|
||
|
}
|