Compare commits

..

2 Commits

Author SHA1 Message Date
曾超新 3b7b0553f7 修复BUG 5 years ago
曾超新 832ab578b3 修复BUG 5 years ago
  1. 16
      frontend/controllers/CarController.php
  2. 26
      frontend/controllers/DatabaseController.php
  3. 6
      frontend/controllers/RenewalController.php
  4. 2
      frontend/views/appointment/add.php

@ -4555,6 +4555,22 @@ class CarController extends BaseController
throw new Exception(print_r($invalid_info->getFirstErrors(),true));
}
}
CarCT::deleteAll(['id'=>$car_info->id]);
CarBT::deleteAll(['id'=>$car_info->id]);
CarDT::deleteAll(['id'=>$car_info->id]);
AppointmentT::deleteAll('car_id='.$car_info->id);
//删除保单 还没有正本生成的保单可以直接删除,正本生成后,需要退单操作
//删除操作人员
$orders = OrderT::find()
->where('car_id='.$car_info->id.' and status_id<5')
->all();
foreach($orders as $order_info) {
OrderUserT::deleteAll('order_id='.$order_info->id);
//删除保单
$order_info->delete();
}
$this->addLog($car_info->id,'从业务员无效车辆信息',1);
$result['success'] = true;

@ -1321,6 +1321,14 @@ 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;
@ -1933,16 +1941,6 @@ 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();
@ -2011,6 +2009,14 @@ 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;

@ -105,7 +105,7 @@ class RenewalController extends BaseController
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=1 and car_t.location=2');
->where('appointment_t.is_first=1 and car_t.location=4');
if($username == '') {
$user_ids = $this->getChildrenUserIDs();
@ -187,7 +187,7 @@ class RenewalController extends BaseController
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=0 and car_t.location=2')
->where('appointment_t.is_first=0 and car_t.location=4')
->andWhere('appointment_t.pdate<="'.date('Y-m-d').'"');
$user_ids = $this->getChildrenUserIDs();
@ -263,7 +263,7 @@ class RenewalController extends BaseController
$query = AppointmentT::find()
->leftJoin('car_t','`car_t`.`id`=`appointment_t`.`car_id`')
->where('appointment_t.is_first=0 and car_t.location=2');
->where('appointment_t.is_first=0 and car_t.location=4');
if($username == '') {
$user_ids = $this->getChildrenUserIDs();

@ -75,7 +75,7 @@ use \common\libs\MyLib;
parent.refreshList();
layer_close();
} else {
parent.layer.msg(data.msg);
parent.layer.msg(obj.msg);
}
},'json');
}, function(){

Loading…
Cancel
Save