|
|
|
@ -1321,14 +1321,6 @@ class DatabaseController extends BaseController |
|
|
|
|
$this->addLog($c_info->id,'从业务员:'.$c_info->user->getShowName().'回收数据',1); |
|
|
|
|
//删除预约 |
|
|
|
|
AppointmentT::deleteAll('user_id='.$c_info->user_id.' and car_id='.$c_info->id); |
|
|
|
|
$orders = OrderT::find() |
|
|
|
|
->where('car_id='.$c_info->id.' and status_id<5') |
|
|
|
|
->all(); |
|
|
|
|
foreach($orders as $order_info) { |
|
|
|
|
OrderUserT::deleteAll('order_id='.$order_info->id); |
|
|
|
|
//删除保单 |
|
|
|
|
$order_info->delete(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$car_info = $c_info->car; |
|
|
|
|
$car_info->user_id = 0; |
|
|
|
@ -1941,6 +1933,16 @@ class DatabaseController extends BaseController |
|
|
|
|
throw new \Exception(print_r($order_row->getErrors(),true)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//添加保单操作员 |
|
|
|
|
$order_user_info = new OrderUserT(); |
|
|
|
|
$order_user_info->user_id = $user_id; |
|
|
|
|
$order_user_info->order_id = $order_row->id; |
|
|
|
|
$order_user_info->type_id = 1; |
|
|
|
|
$order_user_info->status = 0; |
|
|
|
|
if(!$order_user_info->save()) { |
|
|
|
|
throw new \Exception(print_r($order_user_info->getErrors(),true)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//添加预约 |
|
|
|
|
AppointmentT::deleteAll('car_id='.$d_info->id); |
|
|
|
|
$row = new AppointmentT(); |
|
|
|
@ -2009,14 +2011,6 @@ class DatabaseController extends BaseController |
|
|
|
|
$this->addLog($d_info->id,'从业务员:'.$d_info->user->getShowName().'回收跟踪数据',1); |
|
|
|
|
//删除预约 |
|
|
|
|
AppointmentT::deleteAll('user_id='.$d_info->user_id.' and car_id='.$d_info->id); |
|
|
|
|
$orders = OrderT::find() |
|
|
|
|
->where('car_id='.$d_info->id.' and status_id<5') |
|
|
|
|
->all(); |
|
|
|
|
foreach($orders as $order_info) { |
|
|
|
|
OrderUserT::deleteAll('order_id='.$order_info->id); |
|
|
|
|
//删除保单 |
|
|
|
|
$order_info->delete(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$car_info = $d_info->car; |
|
|
|
|
$car_info->user_id = 0; |
|
|
|
|