修复订单数异常

This commit is contained in:
yaooo 2023-08-23 17:33:27 +08:00
parent 470740b8da
commit 85d43f7c56

View File

@ -849,7 +849,7 @@ class StoreOrderRepository extends BaseRepository
//1: 未支付 2: 未发货 3: 待收货 4: 待评价 5: 交易完成 6: 已退款 7: 已删除 8: 已支付 //1: 未支付 2: 未发货 3: 待收货 4: 待评价 5: 交易完成 6: 已退款 7: 已删除 8: 已支付
$all = $this->dao->search($where, $sysDel)->where($this->getOrderType(0))->count(); $all = $this->dao->search($where, $sysDel)->where($this->getOrderType(0))->count();
$statusAll = $all; $statusAll = $all;
$unpaid = $this->dao->search($where, $sysDel)->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)")->count(); $unpaid = $this->dao->search($where, $sysDel)->where($this->getOrderType(1))->whereRaw("(StoreOrder.paid=0 or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)")->count();
$unshipped = $this->dao->search($where, $sysDel)->where($this->getOrderType(2))->count(); $unshipped = $this->dao->search($where, $sysDel)->where($this->getOrderType(2))->count();
$untake = $this->dao->search($where, $sysDel)->where($this->getOrderType(3))->count(); $untake = $this->dao->search($where, $sysDel)->where($this->getOrderType(3))->count();
$unevaluate = $this->dao->search($where, $sysDel)->where($this->getOrderType(4))->where('paid', 1)->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY)->count(); $unevaluate = $this->dao->search($where, $sysDel)->where($this->getOrderType(4))->where('paid', 1)->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY)->count();
@ -1545,7 +1545,7 @@ class StoreOrderRepository extends BaseRepository
$query->where('paid', 1)->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY); $query->where('paid', 1)->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY);
}) })
->when($status == 1, function ($query) { ->when($status == 1, function ($query) {
$query->whereRaw("(StoreOrder.paid=0 and StoreOrder.pay_type!=8) or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)"); $query->whereRaw("StoreOrder.paid=0 or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)");
}) })
->with([ ->with([
'orderProduct', 'orderProduct',