feat(StoreFinanceFlowLists): 添加了财务类型和财务方式的搜索条件

This commit is contained in:
mkm 2024-06-27 09:30:35 +08:00
parent 6478f0f86e
commit 149afec11f

View File

@ -32,7 +32,7 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['store_id', 'user_id', 'create_time', 'staff_id'], '=' => ['store_id', 'user_id', 'create_time', 'staff_id','financial_type','financial_pm','order_id'],
'between_time' => 'create_time', 'between_time' => 'create_time',
'%pipe_like%' => ['keyword' => 'order_sn'], '%pipe_like%' => ['keyword' => 'order_sn'],
]; ];
@ -53,12 +53,15 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt
$field = [ $field = [
'id', 'order_id', 'order_sn', 'create_time', 'other_uid', 'user_id', 'store_id', 'staff_id', 'financial_type', 'financial_pm', 'pay_type', 'type', 'number', 'status' 'id', 'order_id', 'order_sn', 'create_time', 'other_uid', 'user_id', 'store_id', 'staff_id', 'financial_type', 'financial_pm', 'pay_type', 'type', 'number', 'status'
]; ];
$this->searchWhere[] = ['financial_type', '=', 1]; if($this->request->get('order_id')){
$this->searchWhere[] = ['financial_pm', '=', 1]; $order=['financial_pm'=>'desc'];
}else{
$order=['id'=>'desc'];
}
$data = StoreFinanceFlow::where($this->searchWhere) $data = StoreFinanceFlow::where($this->searchWhere)
->field($field) ->field($field)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order($order)
->select()->each(function ($item) { ->select()->each(function ($item) {
if ($item['user_id'] <= 0) { if ($item['user_id'] <= 0) {
$item['nickname'] = '游客'; $item['nickname'] = '游客';