65 lines
1.5 KiB
PHP
65 lines
1.5 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace app\admin\lists\retail;
|
||
|
|
||
|
|
||
|
use app\admin\lists\BaseAdminDataLists;
|
||
|
use app\common\model\retail\Cashierinfo;
|
||
|
use app\common\lists\ListsSearchInterface;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 零售订单详情列表
|
||
|
* Class CashierinfoLists
|
||
|
* @package app\admin\listsretail
|
||
|
*/
|
||
|
class CashierinfoLists extends BaseAdminDataLists implements ListsSearchInterface
|
||
|
{
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 设置搜索条件
|
||
|
* @return \string[][]
|
||
|
* @author likeadmin
|
||
|
* @date 2024/04/24 10:11
|
||
|
*/
|
||
|
public function setSearch(): array
|
||
|
{
|
||
|
return [
|
||
|
'=' => ['pid', 'room', 'goods', 'warehouse', 'serial'],
|
||
|
];
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 获取零售订单详情列表
|
||
|
* @return array
|
||
|
* @throws \think\db\exception\DataNotFoundException
|
||
|
* @throws \think\db\exception\DbException
|
||
|
* @throws \think\db\exception\ModelNotFoundException
|
||
|
* @author likeadmin
|
||
|
* @date 2024/04/24 10:11
|
||
|
*/
|
||
|
public function lists(): array
|
||
|
{
|
||
|
return Cashierinfo::where($this->searchWhere)
|
||
|
->field(['id', 'pid', 'room', 'goods', 'warehouse', 'serial', 'nums', 'price', 'discount', 'total', 'data', 'more', 'sort'])
|
||
|
->limit($this->limitOffset, $this->limitLength)
|
||
|
->order(['id' => 'desc'])
|
||
|
->select()
|
||
|
->toArray();
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @notes 获取零售订单详情数量
|
||
|
* @return int
|
||
|
* @author likeadmin
|
||
|
* @date 2024/04/24 10:11
|
||
|
*/
|
||
|
public function count(): int
|
||
|
{
|
||
|
return Cashierinfo::where($this->searchWhere)->count();
|
||
|
}
|
||
|
|
||
|
}
|