From 3417e462fbdd237c8f767571514b68a39affcd58 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 18 May 2024 16:43:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/OpurchaseclassController.php | 7 +++---- .../lists/operation/OpurchaseclassofferLists.php | 14 +++++++++++++- app/api/logic/order/OrderLogic.php | 4 ++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/admin/controller/operation/OpurchaseclassController.php b/app/admin/controller/operation/OpurchaseclassController.php index 098d533..6a7583c 100644 --- a/app/admin/controller/operation/OpurchaseclassController.php +++ b/app/admin/controller/operation/OpurchaseclassController.php @@ -102,10 +102,9 @@ class OpurchaseclassController extends BaseAdminController if($find){ $item['goods_name'] = $find['name']; $item['unit_name'] = $find['unit_name']; - $goodslabel = GoodsLabel::where('id','in',$item['sys_labels'])->column('id,name'); - if($goodslabel){ - $item['sys_labels_arr'] = implode(',',$goodslabel); - } + $goodslabel = GoodsLabel::where('id','in',$find['sys_labels'])->column('id,name'); + $item['sys_labels_arr'] = $goodslabel; + } }); diff --git a/app/admin/lists/operation/OpurchaseclassofferLists.php b/app/admin/lists/operation/OpurchaseclassofferLists.php index 69f5203..ac76986 100644 --- a/app/admin/lists/operation/OpurchaseclassofferLists.php +++ b/app/admin/lists/operation/OpurchaseclassofferLists.php @@ -19,6 +19,8 @@ use app\common\model\supplier\Supplier; class OpurchaseclassofferLists extends BaseAdminDataLists implements ListsSearchInterface { + protected $where; + /** * @notes 设置搜索条件 @@ -46,6 +48,16 @@ class OpurchaseclassofferLists extends BaseAdminDataLists implements ListsSearch public function lists(): array { $where=[]; + $is_mer=$this->request->get('is_mer',0); + $id=$this->request->get('id',0); + if($is_mer==2){ + $arr=Opurchaseclass::where('id',$id)->value('order_arr'); + if($arr){ + $arr=explode(',',$arr); + $where[]=['order_id','in',$arr]; + } + } + $this->where=$where; return OpurchaseGoodsOffer::where($this->searchWhere) ->where($where) ->limit($this->limitOffset, $this->limitLength) @@ -69,7 +81,7 @@ class OpurchaseclassofferLists extends BaseAdminDataLists implements ListsSearch */ public function count(): int { - return OpurchaseGoodsOffer::where($this->searchWhere)->count(); + return OpurchaseGoodsOffer::where($this->searchWhere)->where($this->where)->count(); } } \ No newline at end of file diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index edc8d8f..e480e53 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -138,9 +138,9 @@ class OrderLogic extends BaseLogic } $mer_id = $user['merchant']['mer_id']; $where1 = ['paid' => 1,'is_opurchase'=>0]; - $where1 = ['pay_type','<>',9]; - $arrs = Cashierclass::where('merchant', $mer_id)->whereDay('create_time')->where($where1)->column('cart_id,id,address_id'); + $where1[] = ['pay_type','<>',9]; + $arrs = Cashierclass::where('merchant', $mer_id)->whereDay('create_time')->where($where1)->column('cart_id,id,address_id'); // $order_id = Cashierclass::where('merchant', $mer_id)->whereDay('create_time')->where($where1)->column('id'); $cart_arr = []; $order_id = [];