From b37080e87364ac5fee5e6dd8cceee489f5fb551b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 14 Oct 2024 18:10:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=8A=A5=E4=BB=B7=E5=88=97=E8=A1=A8=E7=9A=84=E5=BA=97?= =?UTF-8?q?=E9=93=BA=E5=90=8D=E7=A7=B0=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在搜索条件中增加店铺名称(store_name) - 实现根据店铺名称搜索相关产品,并返回对应报价信息 - 添加店铺名称搜索逻辑,优化搜索结果准确性 - 修复可能存在的搜索空结果问题 --- .../PurchaseProductOfferLists.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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(); }