From 68d812ce24171bbf1d33ff8edf1dfefbe502edb9 Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Thu, 2 Jun 2022 13:38:52 +0800 Subject: [PATCH] edit-admin-add_pay_log --- admin/controllers/receiver/orderv2/Orders.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/controllers/receiver/orderv2/Orders.php b/admin/controllers/receiver/orderv2/Orders.php index 63928ce3..1fac92b0 100644 --- a/admin/controllers/receiver/orderv2/Orders.php +++ b/admin/controllers/receiver/orderv2/Orders.php @@ -740,7 +740,10 @@ class Orders extends HD_Controller return $this->show_json(SYS_CODE_FAIL, '车款金额错误'); } $this->app_liche_orders_model->update(['status'=>-1],['o_id'=>$row['id'],'status'=>0,'type'=>1]); //定金更新成无效订单 - if(!$this->app_liche_orders_model->count(['pid'=>$last_p_row['id'],'type'=>3,'status'=>1])){ + $money_json = json_decode($row['money_json'],true); + $last_pay_count = $this->app_liche_orders_model->count(['pid'=>$last_p_row['id'],'type'=>3,'status'=>1]);//尾款支付订单 + $adimn_count = $this->app_liche_orders_model->count(['o_id'=>$row['id'],'type'=>6,'status'=>1]);//车款订单 + if(!$last_pay_count && ($money!=$money_json['price_book'] || $adimn_count)){ //若首笔金额 == 定金金额,尾款订单不要置为 -1若金额 > 定金金额 或者 非首笔,尾款订单置为 -1 $this->app_liche_orders_model->update(['status'=>-1],['o_id'=>$row['id'],'type'=>3]); //尾款更新成无效订单 } }else{ //服务费