From f7cd7cb2f7a113dab7fd5a9d24845f42d6a8b7c0 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 15 Oct 2024 14:27:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=94=A8=E6=88=B7=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=9A=90=E8=97=8F=E4=BB=B7=E6=A0=BC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在BeforehandOrderThreeLists、BeforehandOrderTwoLists和PurchaseProductOfferLists类中,根据管理员的职位ID决定是否隐藏价格信息。如果用户职位ID为1,价格信息将被替换为星号(*),以防止敏感信息泄露。这一改动确保了数据的保密性,满足不同职位用户的查看需求。 --- .../beforehand_order/BeforehandOrderThreeLists.php | 9 ++++++++- .../lists/beforehand_order/BeforehandOrderTwoLists.php | 9 ++++++++- .../PurchaseProductOfferLists.php | 10 ++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/admin/lists/beforehand_order/BeforehandOrderThreeLists.php b/app/admin/lists/beforehand_order/BeforehandOrderThreeLists.php index 726bca26c..048e00b3e 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderThreeLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderThreeLists.php @@ -51,8 +51,9 @@ class BeforehandOrderThreeLists extends BaseAdminDataLists implements ListsSearc $this->outbound_id=$outbound_id; $this->searchWhere[]=['oid','=',$outbound_id]; $this->searchWhere[]=['financial_pm','=',0]; + $job_ids=$this->adminInfo['job_ids']??[]; return WarehouseProduct::where($this->searchWhere)->select() - ->each(function($item){ + ->each(function($item) use($job_ids){ $find=StoreProduct::where('id',$item['product_id'])->field('store_name,image,unit')->withTrashed()->find(); $item['store_name']=$find['store_name']; $item['image']=$find['image']; @@ -66,6 +67,12 @@ class BeforehandOrderThreeLists extends BaseAdminDataLists implements ListsSearc }else{ $item['supplier_name']=''; } + foreach($job_ids as $k=>$v){ + if($v==1){ + $item->price='*'; + $item->total_price='*'; + } + } return $item; }) ->toArray(); diff --git a/app/admin/lists/beforehand_order/BeforehandOrderTwoLists.php b/app/admin/lists/beforehand_order/BeforehandOrderTwoLists.php index 1b47ce629..7875386d9 100644 --- a/app/admin/lists/beforehand_order/BeforehandOrderTwoLists.php +++ b/app/admin/lists/beforehand_order/BeforehandOrderTwoLists.php @@ -51,8 +51,9 @@ class BeforehandOrderTwoLists extends BaseAdminDataLists implements ListsSearchI $this->warehousing_id=$warehousing_id; $this->searchWhere[]=['oid','=',$warehousing_id]; $this->searchWhere[]=['financial_pm','=',1]; + $job_ids=$this->adminInfo['job_ids']??[]; return WarehouseProduct::where($this->searchWhere)->select() - ->each(function($item){ + ->each(function($item) use($job_ids){ $find=StoreProduct::where('id',$item['product_id'])->field('store_name,image,unit')->withTrashed()->find(); $item['store_name']=$find['store_name']; $item['image']=$find['image']; @@ -66,6 +67,12 @@ class BeforehandOrderTwoLists extends BaseAdminDataLists implements ListsSearchI }else{ $item['supplier_name']=''; } + foreach($job_ids as $k=>$v){ + if($v==1){ + $item->price='*'; + $item->total_price='*'; + } + } return $item; }) ->toArray(); diff --git a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php index ae004f90f..9a7342d8f 100644 --- a/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/admin/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -57,11 +57,12 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc $this->is_ids=1; } } + $job_ids=$this->adminInfo['job_ids']??[]; 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) ->order(['id' => 'desc']) - ->select()->each(function($item){ + ->select()->each(function($item) use($job_ids){ $find=StoreProduct::where('id',$item->product_id)->withTrashed()->find(); $item->store_name=$find->store_name; $item->store_info=$find->store_info; @@ -95,7 +96,12 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc $item->is_storage_name='未入库'; } $item->pay_type_name=$item->pay_type==1?'赊账':'现金'; - + foreach($job_ids as $k=>$v){ + if($v==1){ + $item->price='*'; + $item->total_price='*'; + } + } }) ->toArray(); }