2025-03-03 11:38:13 +08:00
|
|
|
<?php
|
|
|
|
|
2025-03-10 11:31:34 +08:00
|
|
|
namespace app\psi\lists;
|
2025-03-03 11:38:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
use app\common\lists\BaseDataLists;
|
2025-03-10 11:31:34 +08:00
|
|
|
use app\common\model\OutboundProduct;
|
2025-03-03 11:38:13 +08:00
|
|
|
use app\common\lists\ListsSearchInterface;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2025-03-10 11:31:34 +08:00
|
|
|
* PsiOutboundProduct列表
|
|
|
|
* Class OutboundProductLists
|
|
|
|
* @package app\psi\lists
|
2025-03-03 11:38:13 +08:00
|
|
|
*/
|
2025-03-10 11:31:34 +08:00
|
|
|
class OutboundProductLists extends BaseDataLists implements ListsSearchInterface
|
2025-03-03 11:38:13 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes 设置搜索条件
|
|
|
|
* @return \string[][]
|
|
|
|
* @author admin
|
2025-03-10 11:31:34 +08:00
|
|
|
* @date 2025/03/10 11:08
|
2025-03-03 11:38:13 +08:00
|
|
|
*/
|
|
|
|
public function setSearch(): array
|
|
|
|
{
|
|
|
|
return [
|
2025-03-10 11:31:34 +08:00
|
|
|
'=' => ['warehouse_id', 'supplier_id', 'store_id', 'order_type', 'product_id', 'oid', 'code', 'pay_type', 'status'],
|
|
|
|
|
2025-03-03 11:38:13 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes 获取列表
|
|
|
|
* @return array
|
|
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
|
|
* @throws \think\db\exception\DbException
|
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
|
* @author admin
|
2025-03-10 11:31:34 +08:00
|
|
|
* @date 2025/03/10 11:08
|
2025-03-03 11:38:13 +08:00
|
|
|
*/
|
|
|
|
public function lists(): array
|
|
|
|
{
|
2025-03-10 11:31:34 +08:00
|
|
|
return OutboundProduct::where($this->searchWhere)
|
|
|
|
->field(['id', 'warehouse_id', 'supplier_id', 'store_id', 'order_type', 'product_id', 'oid', 'code', 'nums', 'refund_nums', 'before_nums', 'after_nums', 'mark', 'total_price', 'purchase', 'is_pay', 'pay_type', 'status'])
|
2025-03-03 11:38:13 +08:00
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
|
->order(['id' => 'desc'])
|
|
|
|
->select()
|
|
|
|
->toArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes 获取数量
|
|
|
|
* @return int
|
|
|
|
* @author admin
|
2025-03-10 11:31:34 +08:00
|
|
|
* @date 2025/03/10 11:08
|
2025-03-03 11:38:13 +08:00
|
|
|
*/
|
|
|
|
public function count(): int
|
|
|
|
{
|
2025-03-10 11:31:34 +08:00
|
|
|
return OutboundProduct::where($this->searchWhere)->count();
|
2025-03-03 11:38:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|