diff --git a/app/common/dao/store/order/StoreOrderDao.php b/app/common/dao/store/order/StoreOrderDao.php index a9efc065..201c1f2f 100644 --- a/app/common/dao/store/order/StoreOrderDao.php +++ b/app/common/dao/store/order/StoreOrderDao.php @@ -74,7 +74,16 @@ class StoreOrderDao extends BaseDao } $query->where('is_del', 0); }); - + if (isset($where['source']) && $where['source'] == 103) { + $wheres['activity_type'] = [0,98]; + $wheres['source'] = [0,2,103]; + $query->where($wheres); + unset($where['source']); + } else { + if(isset($where['product_type']) && $where['product_type'] !== ''){ + $query->where('activity_type', $where['product_type']); + } + } $query->when(($sysDel !== null), function ($query) use ($sysDel) { $query->where('is_system_del', $sysDel); }) @@ -220,15 +229,6 @@ class StoreOrderDao extends BaseDao $query->where('reconciliation_id', 0); }); })->order('StoreOrder.create_time DESC'); - if (isset($where['source']) && $where['source'] == 103) { - $wheres['activity_type'] = [0, 98]; - $wheres['source'] = [2, 103]; - $query->where($wheres); - } else { - if(isset($where['product_type']) && $where['product_type'] !== ''){ - $query->where('activity_type', $where['product_type']); - } - } return $query; } diff --git a/app/common/repositories/store/order/StoreGroupOrderRepository.php b/app/common/repositories/store/order/StoreGroupOrderRepository.php index df4d1e79..4f285909 100644 --- a/app/common/repositories/store/order/StoreGroupOrderRepository.php +++ b/app/common/repositories/store/order/StoreGroupOrderRepository.php @@ -67,7 +67,7 @@ class StoreGroupOrderRepository extends BaseRepository $query = StoreGroupOrder::getDB()->alias('StoreGroupOrder'); if(isset($where['source']) && $where['source'] == 103){ $wheres['activity_type']=[0,98]; - $wheres['source']=[2,103]; + $wheres['source']=[0,2,103]; }else{ $wheres['activity_type']=0; } diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 5956bbc5..1dbbdc29 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -639,7 +639,7 @@ class StoreOrderRepository extends BaseRepository $where['activity_type']=$product_type; if($source==103){ $where['activity_type']=[0,98]; - $where['source']=[2,103]; + $where['source']=[0,2,103]; } $noComment = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(4))->where($where)->where('StoreOrder.is_del', 0)->count(); $noPay = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(1))->whereRaw("(StoreOrder.paid=0 and StoreOrder.pay_type!=8) or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)")->where($where)->where('StoreOrder.is_del', 0)->count();