edit-api-pay_up_customer

This commit is contained in:
lccsw
2022-04-27 17:30:11 +08:00
parent d524851e6c
commit 10e8e9218d
3 changed files with 9 additions and 1 deletions
@@ -768,6 +768,8 @@ class Orders extends HD_Controller
if($row['order_time'] == '0000-00-00 00:00:00'){ //更新下定时间
$this->receiver_orders_v2_model->update(['order_time' => date('Y-m-d H:i:s',strtotime($pay_time))], ['id' => $row['id']]);
}
//更新客户为订单客户
$this->customers_model->update(['status'=>2],['id'=>$row['customer_id']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}
+4 -1
View File
@@ -21,6 +21,7 @@ class Wxnotify_v3 extends CI_Controller{
$this->load->model('app/liche/app_liche_orders_model');
$this->load->model('receiver/order/receiver_orders_model');
$this->load->model('receiver/receiver_customers_model','customers_model');
$this->load->library('receiver/orders_v2_entity');
$this->load->library('qyrobot');
@@ -137,11 +138,11 @@ class Wxnotify_v3 extends CI_Controller{
}else{
$result = $this->payment_service->after_pay_liche($sid,$result['data']['amount']['payer_total']/100);
if($result['code']){
$receiver_order = $this->receiver_orders_model->get(['id'=>$order['o_id']]);
$is_ts = false;
if($order['type']==1){ //定金
$is_ts = true;
}elseif($order['type']==4){ //意向金
$receiver_order = $this->receiver_orders_model->get(['id'=>$order['o_id']]);
if($receiver_order['deposit'] == $order['total_price']){
$is_ts = true;
}
@@ -150,6 +151,8 @@ class Wxnotify_v3 extends CI_Controller{
$robot_res = $this->qyrobot->deposit_notify($order['o_id']);
debug_log("[info] ". __FUNCTION__ . ":推送企业微信群 ".json_encode($robot_res,JSON_UNESCAPED_UNICODE), $this->log_file,$this->log_dir);
}
//更新客户为订单客户
$this->customers_model->update(['status'=>2],['id'=>$receiver_order['rid']]);
debug_log("[success] ". __FUNCTION__ . ":操作成功", $this->log_file,$this->log_dir);
}else{
debug_log("[error] ". __FUNCTION__ . ":".$result['msg'], $this->log_file,$this->log_dir);
@@ -301,6 +301,9 @@ class Payment_service extends HD_Service{
if($need_pay_money && $is_pay['total_price']>=$need_pay_money){ //完成支付
$this->orders_status_entity->set_status($order['o_id'],0,2);
}
//更新客户为订单客户
$order = $this->receiver_orders_v2_model->get(['id' => $order['o_id']],'customer_id');
$this->customers_model->update(['status'=>2],['id'=>$order['customer_id']]);
return array('code'=>1,'msg'=>'操作成功');
}else{
return array('code'=>0,'msg'=>'更新失败');