diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 9fc8b397..99a17ec5 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -617,19 +617,15 @@ class OrderLogic extends BaseLogic } $financeFlowLogic = new StoreFinanceFlowLogic(); //other_uid大于0的 - $select_1 = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 1])->where('other_uid','>',0)->select(); + $select_1 = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 1,'status'=>0])->where('other_uid','>',0)->select(); foreach ($select_1 as $k => $v) { if ($v['other_uid'] > 0) { $financeFlowLogic->updateStatusUser($v['id'], $v['other_uid'], $v['number'], $v['order_id']); } } - // $spread_find = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 1, 'financial_type' => 12, 'other_uid' => $order['spread_uid']])->find(); - // if ($spread_find) { - // $financeFlowLogic->updateStatusUser($spread_find['id'], $order['spread_uid'], $spread_find['number'], $order['id']); - // } - - $deposit = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 0, 'financial_type' => 11])->value('number') ?? 0; - $money = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 1, 'financial_type' => 2])->value('number') ?? 0; + + $deposit = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 0, 'financial_type' => 11,'status'=>0])->value('number') ?? 0; + $money = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 1, 'financial_type' => 2,'status'=>0])->value('number') ?? 0; $financeFlowLogic->updateStatusStore($order['id'], $order['store_id'], $money, $deposit); //积分结算 if ($order['is_storage'] == 0 && $order['source'] == 0) {