diff --git a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php index f292d17ee..348efc919 100644 --- a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -21,6 +21,7 @@ use app\common\model\supplier\Supplier; class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface { + public $is_ids; /** * @notes 设置搜索条件 @@ -47,6 +48,15 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc */ public function lists(): array { + $store_name=$this->request->get('store_name'); + if($store_name){ + $ids=StoreProduct::where('store_name','like','%'.$store_name.'%')->column('id'); + if($ids){ + $this->searchWhere[]=['product_id','in',$ids]; + }else{ + $this->is_ids=1; + } + } return PurchaseProductOffer::where($this->searchWhere) ->field(['id', 'supplier_id', 'order_id', 'product_id', 'price','total_price', 'buyer_nums', 'unit', 'is_buyer', 'buyer_confirm', 'is_storage', 'is_stream', 'need_num', 'mark', 'buyer_id', 'status', 'stream_admin_id', 'stream_time', 'storage_admin_id']) ->limit($this->limitOffset, $this->limitLength) @@ -84,6 +94,7 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc }else{ $item->is_storage_name='未入库'; } + $item->pay_type_name=$item->pay_type==1?'赊账':'现金'; }) ->toArray(); @@ -98,6 +109,9 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc */ public function count(): int { + if($this->is_ids==1){ + return 0; + } return PurchaseProductOffer::where($this->searchWhere)->count(); }