diff --git a/app/common/dao/store/order/StoreGroupOrderDao.php b/app/common/dao/store/order/StoreGroupOrderDao.php index a749c7d6..6b2f48d6 100644 --- a/app/common/dao/store/order/StoreGroupOrderDao.php +++ b/app/common/dao/store/order/StoreGroupOrderDao.php @@ -59,6 +59,7 @@ class StoreGroupOrderDao extends BaseDao */ public function search(array $where) { + $where['product_type'] = empty($where['product_type']) ? [0, 98] : $where['product_type']; if (is_array($where['product_type'])) { $storeOrderWhere = StoreOrder::whereIn('activity_type', $where['product_type']); } else { diff --git a/app/common/repositories/store/order/StoreGroupOrderRepository.php b/app/common/repositories/store/order/StoreGroupOrderRepository.php index fab54ec7..acf2f034 100644 --- a/app/common/repositories/store/order/StoreGroupOrderRepository.php +++ b/app/common/repositories/store/order/StoreGroupOrderRepository.php @@ -146,7 +146,7 @@ class StoreGroupOrderRepository extends BaseRepository */ public function cancel($id, $uid = null) { - $groupOrder = $this->search(['paid' => 0, 'uid' => $uid ?? '', 'product_type' => [0, 98]])->where('StoreGroupOrder.group_order_id', $id)->with(['orderList'])->find(); + $groupOrder = $this->search(['paid' => 0, 'uid' => $uid ?? ''])->where('group_order_id', $id)->with(['orderList'])->find(); if (!$groupOrder) throw new ValidateException('订单不存在'); if ($groupOrder['paid'] != 0)