diff --git a/app/common/dao/store/order/StoreGroupOrderDao.php b/app/common/dao/store/order/StoreGroupOrderDao.php index 0dd2cd6..b77c845 100644 --- a/app/common/dao/store/order/StoreGroupOrderDao.php +++ b/app/common/dao/store/order/StoreGroupOrderDao.php @@ -47,11 +47,18 @@ class StoreGroupOrderDao extends BaseDao */ public function search(array $where,$is_points = null) { + + $isWithGoods = $where['is_with_goods'] ?? 0; + $query = StoreGroupOrder::getDB() ->when(isset($where['paid']) && $where['paid'] !== '',function($query) use ($where){ $query->where('paid',$where['paid']); }) - ->whereNotIn('activity_type',[30,31,32,33,34,36,37,38]) + ->when($isWithGoods == 1,function($query) use ($where){ + $query->whereNotIn('activity_type',[30,31,32,33,34,36,37,38]); + },function($query) use ($where){ + $query->whereNotIn('activity_type',[30,31,32,33,34,35,36,37,38]); + }) ->when(isset($where['paid']) && $where['paid'] !== '',function($query) use ($where){ $query->where('paid',$where['paid']); }) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 2c6787f..dd7d7ca 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -762,7 +762,7 @@ class StoreOrderRepository extends BaseRepository // 酒道馆进货订单 public function merOrderNumber(int $merId) { - $noPay =app()->make(StoreGroupOrderRepository::class)->search(['with_goods_mer_id' => $merId,'activity_type' => 35,'is_del' => 0,'paid' => 0],0)->count(); + $noPay =app()->make(StoreGroupOrderRepository::class)->search(['is_with_goods'=>1,'with_goods_mer_id' => $merId,'activity_type' => 35,'is_del' => 0,'paid' => 0],0)->count(); $noPostage = $this->dao->search(['with_goods_mer_id' => $merId,'activity_type' => 35, 'status' => 0, 'paid' => 1,'is_user' => 1])->where('StoreOrder.is_del', 0)->count(); $all = $this->dao->search(['with_goods_mer_id' => $merId,'activity_type' => 35, 'status' => -2,'is_user' => 1])->where('StoreOrder.is_del', 0)->count(); $noDeliver = $this->dao->search(['with_goods_mer_id' => $merId,'activity_type' => 35, 'status' => 1, 'paid' => 1])->where('StoreOrder.is_del', 0)->count(); diff --git a/app/controller/api/store/order/StoreOrder.php b/app/controller/api/store/order/StoreOrder.php index 79a727a..cdd15ab 100644 --- a/app/controller/api/store/order/StoreOrder.php +++ b/app/controller/api/store/order/StoreOrder.php @@ -249,7 +249,21 @@ class StoreOrder extends BaseController public function groupOrderList(StoreGroupOrderRepository $groupOrderRepository) { [$page, $limit] = $this->getPage(); - $list = $groupOrderRepository->getList(['uid' => $this->request->uid(), 'paid' => 0], $page, $limit); + $params = $this->request->params([ + ['is_with_goods', 0], + ['with_goods_mer_id', 0] + ]); + if($params['is_with_goods'] != 1) $params['with_goods_mer_id'] = ''; + // 条件 + $where = [ + 'uid' => $this->request->uid(), + 'paid' => 0, + 'with_goods_mer_id' => $params['with_goods_mer_id'], + 'is_with_goods' => $params['is_with_goods'] + ]; + // 列表获取 + $list = $groupOrderRepository->getList($where, $page, $limit); + return app('json')->success($list); } diff --git a/app/controller/api/user/Svip.php b/app/controller/api/user/Svip.php index 125ba6c..3b80d0b 100644 --- a/app/controller/api/user/Svip.php +++ b/app/controller/api/user/Svip.php @@ -82,14 +82,11 @@ class Svip extends BaseController public function createOrder($id, GroupDataRepository $groupDataRepository, UserOrderRepository $userOrderRepository) { $params = $this->request->params(['pay_type','return_url','bind_mer_id','bind_staff_id']); - if (!in_array($params['pay_type'], ['weixin', 'routine', 'h5', 'alipay', 'alipayQr', 'weixinQr'], true)) - return app('json')->fail('请选择正确的支付方式'); + if (!in_array($params['pay_type'], ['weixin', 'routine', 'h5', 'alipay', 'alipayQr', 'weixinQr', 'balance'], true)) return app('json')->fail('请选择正确的支付方式'); $res = $groupDataRepository->getWhere(['group_data_id' => $id, 'status' => 1]); if (!$res) return app('json')->fail('参数有误~'); - if ($this->request->userInfo()->is_svip == 3) - return app('json')->fail('您已经是终身会员~'); - if ($this->request->userInfo()->is_svip !== -1 && $res['value']['svip_type'] == 1) - return app('json')->fail('请选择其他会员类型'); + if ($this->request->userInfo()->is_svip == 3) return app('json')->fail('您已经是终身会员~'); + if ($this->request->userInfo()->is_svip !== -1 && $res['value']['svip_type'] == 1) return app('json')->fail('请选择其他会员类型'); $params['is_app'] = $this->request->isApp(); return $userOrderRepository->add($res,$this->request->userInfo(),$params); }