erp/app/api/lists/order/StatisticsList.php
2024-05-16 10:28:29 +08:00

66 lines
1.5 KiB
PHP

<?php
namespace app\api\lists\order;
use app\admin\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\goods\Goods;
use app\common\model\retail\Cashierclass;
use app\common\model\retail\Cashierinfo;
/**
* 统计列表
* Class RetailOrderList
* @package app\api\order
*/
class StatisticsList extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
*/
public function setSearch(): array
{
return [
'=' => ['paid','status','source'],
'between_time' => 'create_time',
'%like%' => ['number'],
];
}
/**
* @notes 零售订单列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @date 2024/04/27 11:26
*/
public function lists(): array
{
$userId=$this->request->userId;
if(!$userId) return [];
return Cashierclass::where($this->searchWhere)->where('uid',$userId)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 零售订单数量
* @return int
* @date 2024/04/27 11:26
*/
public function count(): int
{
return Cashierclass::where($this->searchWhere)->count();
}
}