From 6d79a72c93083cfb764a2e4a244aa2233d66e894 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Tue, 11 Jul 2023 11:56:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=85=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreGroupOrderRepository.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/store/order/StoreGroupOrderRepository.php b/app/common/repositories/store/order/StoreGroupOrderRepository.php index 46ee5bfa..c84e7547 100644 --- a/app/common/repositories/store/order/StoreGroupOrderRepository.php +++ b/app/common/repositories/store/order/StoreGroupOrderRepository.php @@ -63,11 +63,24 @@ class StoreGroupOrderRepository extends BaseRepository */ public function getList(array $where, $page, $limit) { - $query = $this->search($where); + $query = StoreGroupOrder::getDB()->alias('StoreGroupOrder'); if (isset($where['product_type'])) { $storeOrderWhere = StoreOrder::where('activity_type', $where['product_type']); $query->hasWhere('orderList', $storeOrderWhere); } + $query->when(isset($where['paid']) && $where['paid'] !== '', function ($query) use ($where) { + if ($where['paid'] == 0) { + $query->whereRaw("StoreGroupOrder.paid=0 or (StoreGroupOrder.paid=1 and StoreGroupOrder.pay_type=8)"); + } else { + $query->where('StoreGroupOrder.paid', $where['paid']); + } + })->when(isset($where['uid']) && $where['uid'] !== '', function ($query) use ($where) { + $query->where('StoreGroupOrder.uid', $where['uid']); + })->order('create_time DESC')->when(isset($where['is_del']) && $where['is_del'] !== '', function ($query) use ($where) { + $query->where('StoreGroupOrder.is_del', $where['is_del']); + }, function ($query) { + $query->where('StoreGroupOrder.is_del', 0); + }); $count = $query->count(); $list = $query->with(['orderList' => function (Relation $query) { $query->field('order_id,group_order_id,activity_type,pay_price,status,mer_id')->with(['merchant' => function ($query) {