修复:进货订单 - 待支付订单会在用户的待支付订单列表中显示的问题

This commit is contained in:
wuhui_zzw 2024-06-24 17:49:31 +08:00
parent e2d833095d
commit 2026084d83
4 changed files with 27 additions and 9 deletions

View File

@ -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']);
})

View File

@ -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();

View File

@ -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);
}

View File

@ -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);
}