edit-common-update_order_time

This commit is contained in:
lccsw
2022-05-09 22:12:56 +08:00
parent 3a1778eed3
commit be8e28a1bf
+5 -5
View File
@@ -270,7 +270,6 @@ class Payment_service extends HD_Service{
$last_p_row = $this->app_liche_orders_model->get(['o_id'=>$order['o_id'],'type'=>3,'pid'=>$p_row['id'],'status>='=>0]); //尾款父订单
switch ($order['type']){
case 1: //定金
$row = $this->receiver_orders_v2_model->get(['id' => $order['o_id']]);
break;
case 3:
$last_is_pay = $this->app_liche_orders_model->sum('total_price',['status'=>1,'pid'=>$last_p_row['id']]); //已支付尾款
@@ -279,8 +278,6 @@ class Payment_service extends HD_Service{
}
break;
case 4:
//更新订单下定时间
$this->receiver_orders_v2_model->update(['order_time' => date('Y-m-d H:i:s')], ['id' => $order['o_id']]);
break;
default:
}
@@ -299,8 +296,11 @@ class Payment_service extends HD_Service{
$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']]);
$row = $this->receiver_orders_v2_model->get(['id' => $order['o_id']],'customer_id');
if($row['order_time']=='0000-00-00 00:00:00' && $order['type']!=4){//更新订单下定时间
$this->receiver_orders_v2_model->update(['order_time' => date('Y-m-d H:i:s')], ['id' => $row['id']]);
}
$this->customers_model->update(['status'=>2],['id'=>$row['customer_id']]);
return array('code'=>1,'msg'=>'操作成功');
}else{
return array('code'=>0,'msg'=>'更新失败');