修改信用购订单的错误

This commit is contained in:
luofei 2023-07-11 16:19:42 +08:00
parent 11345e97bd
commit cbf99b8139
2 changed files with 4 additions and 7 deletions

View File

@ -48,7 +48,7 @@ class StoreGroupOrderDao extends BaseDao
$storeOrderWhere = StoreOrder::where('activity_type', $productType);
return StoreGroupOrder::hasWhere('orderList', $storeOrderWhere)->when($uid, function ($query, $uid) {
$query->where('StoreGroupOrder.uid', $uid);
})->where('StoreGroupOrder.is_del', 0)->whereRaw("StoreGroupOrder.paid=0 or (StoreGroupOrder.paid=1 and StoreGroupOrder.pay_type=8)")->count();
})->where('StoreGroupOrder.is_del', 0)->whereRaw("StoreGroupOrder.paid=0 or (StoreGroupOrder.paid=1 and StoreGroupOrder.pay_type=8 and StoreOrder.status=2)")->count();
}
/**

View File

@ -70,7 +70,7 @@ class StoreGroupOrderRepository extends BaseRepository
}
$query->when(isset($where['paid']) && $where['paid'] !== '', function ($query) use ($where) {
if ($where['paid'] == 0) {
$query->whereRaw("StoreGroupOrder.paid=0 or (StoreGroupOrder.paid=1 and StoreGroupOrder.pay_type=8)");
$query->whereRaw("StoreGroupOrder.paid=0 or (StoreGroupOrder.paid=1 and StoreGroupOrder.pay_type=8 and StoreOrder.status=2)");
} else {
$query->where('StoreGroupOrder.paid', $where['paid']);
}
@ -128,14 +128,11 @@ class StoreGroupOrderRepository extends BaseRepository
if (empty($order)) {
throw new DataNotFoundException('订单不存在或已取消');
}
$return = $order->toArray();
if (!empty($order->interest)) {
$interest = $order->interest->calculateInterest();
$return['interest']['total_amount'] = bcadd($order->interest->total_price, $interest, 2);
} else {
$return['interest']['total_amount'] = $order['total_price'];
$order->interest->total_amount = bcadd($order->interest->total_price, $interest, 2);
}
return $return;
return $order;
}
public function status($uid, $id)