Compare commits

..

7 Commits

  1. 35
      frontend/controllers/InsurerController.php
  2. 3
      frontend/controllers/MarketingStrategyController.php
  3. 12
      frontend/controllers/StatisticsController.php
  4. 5
      frontend/views/statistics/work-info.php

@ -597,6 +597,7 @@ class InsurerController extends BaseController
if($company2_id > 0) { if($company2_id > 0) {
$query->andWhere('company2_id=:company2_id',[':company2_id'=>$company2_id]); $query->andWhere('company2_id=:company2_id',[':company2_id'=>$company2_id]);
} }
// echo $query->createCommand()->rawSql;
$query = $query->orderBy('updated_at asc'); $query = $query->orderBy('updated_at asc');
$total = $query->count(); $total = $query->count();
@ -2033,7 +2034,7 @@ class InsurerController extends BaseController
if($request->isPost) { if($request->isPost) {
$order_id = $request->post('order_id',0); $order_id = $request->post('order_id',0);
$return_status_id = $request->post('return_status_id',0); $return_status_id = $request->post('return_status_id',2);
$return_remark = $request->post('return_remark'); $return_remark = $request->post('return_remark');
$tran = OrderT::getDb()->beginTransaction(); $tran = OrderT::getDb()->beginTransaction();
@ -2045,7 +2046,8 @@ class InsurerController extends BaseController
} }
$row->status_id = 1; $row->status_id = 1;
$row->return_status_id = $return_status_id; $row->return_status_id = $row->status_id;
if($row->return_status_id == 0) $row->return_status_id = 2;
$row->return_remark = $return_remark; $row->return_remark = $return_remark;
$row->return_time = time(); $row->return_time = time();
// if($return_status_id == 2) { // if($return_status_id == 2) {
@ -3720,22 +3722,27 @@ class InsurerController extends BaseController
// 订单信息更新 // 订单信息更新
$order_info->return_status_id = $order_info->status_id; $order_info->return_status_id = $order_info->status_id;
if($order_info->return_status_id == 0) $order_info->return_status_id = 2;
$order_info->lock_id = 0; $order_info->lock_id = 0;
$order_info->status_id = 1; $order_info->status_id = 1;
$order_info->return_remark = $return_remark; $order_info->return_remark = $return_remark;
$order_info->return_time = time(); $order_info->return_time = time();
$order_info->gift_status = 0; $order_info->gift_status = 0;
// 车辆信息处理 // 车辆信息处理
if ($order_info->car->op2_id > 0) { //续保 $car_info = $order_info->car;
$order_info->car->location = 4; if ($car_info->op2_id > 0) { //续保
$car_info->location = 4;
}else { }else {
$order_info->car->location = 2; $car_info->location = 2;
$order_info->car->is_xubao = 0; $car_info->is_xubao = 0;
} }
$order_info->car->user_id = $order_info->user_id; // $car_info->user_id = $order_info->user_id;
$tran = OrderT::getDb()->beginTransaction(); $tran = OrderT::getDb()->beginTransaction();
try { try {
if(!$car_info->save()) {
throw new \Exception(print_r($car_info->getErrors(), true));
}
// 财务处理 // 财务处理
CaiwuT::deleteAll(['order_id'=>$order_info->id]); CaiwuT::deleteAll(['order_id'=>$order_info->id]);
OrderCaiwuT::deleteAll(['order_id'=>$order_info->id]); OrderCaiwuT::deleteAll(['order_id'=>$order_info->id]);
@ -3744,17 +3751,21 @@ class InsurerController extends BaseController
// 车辆信息 // 车辆信息
CarCT::deleteAll(['id' => $order_info->car_id]); CarCT::deleteAll(['id' => $order_info->car_id]);
// 检测车辆是否移库 // 检测车辆是否移库
if($order_info->car->op2_id > 0 && $order_info->car->location != 4){ if($car_info->op2_id > 0 && $car_info->location != 4){
$car_db_info = new CarDT(false); $car_db_info = new CarDT(false);
$car_db_info->id = $order_info->car_id; $car_db_info->id = $order_info->car_id;
$car_db_info->user_id = $order_info->user_id; $car_db_info->user_id = $order_info->user_id;
$order_info->car->save(); if(!$car_db_info->save()) {
throw new \Exception(print_r($car_db_info->getErrors(), true));
}
} }
if(!$order_info->car->op2_id && $order_info->car->location != 2){ if(!$order_info->car->op2_id && $order_info->car->location != 2){
$car_db_info = new CarBT(false); $car_db_info = new CarBT(false);
$car_db_info->id = $order_info->car_id; $car_db_info->id = $order_info->car_id;
$car_db_info->user_id = $order_info->user_id; $car_db_info->user_id = $order_info->user_id;
$order_info->car->save(); if(!$car_db_info->save()) {
throw new \Exception(print_r($car_db_info->getErrors(), true));
}
} }
// 礼品状态回退 // 礼品状态回退
@ -3762,7 +3773,9 @@ class InsurerController extends BaseController
OrderGiftT::updateAll(['gift_src' => ''], ['order_id' => $order_info->id]); OrderGiftT::updateAll(['gift_src' => ''], ['order_id' => $order_info->id]);
$this->addLog($order_info->car_id,'超管退单,理由是:'.$return_remark,1); $this->addLog($order_info->car_id,'超管退单,理由是:'.$return_remark,1);
$order_info->save(); if(!$order_info->save()) {
throw new \Exception(print_r($order_info->getErrors(), true));
}
$tran->commit(); $tran->commit();
$result['success'] = true; $result['success'] = true;
$result['msg'] = '操作成功'; $result['msg'] = '操作成功';

@ -582,6 +582,9 @@ class MarketingStrategyController extends UserBaseController
$ids[] = $item->id; $ids[] = $item->id;
} }
} }
if(count($ids) == 0) {
return $result;
}
$result['success'] = true; $result['success'] = true;
$result['ids'] = join(',',$ids); $result['ids'] = join(',',$ids);
$result['celuo_id'] = $yingxiao_item->id; $result['celuo_id'] = $yingxiao_item->id;

@ -506,9 +506,19 @@ class StatisticsController extends BaseController
public function actionWorkInfo() { public function actionWorkInfo() {
$request = Yii::$app->request; $request = Yii::$app->request;
$user_id = $request->get('user_id'); $user_id = $request->get('user_id');
$date_begin = $request->get('date_begin');
$date_end = $request->get('date_end');
$date2_begin = $request->get('date2_begin');
$date2_end = $request->get('date2_end');
$username = $request->get('username');
return $this->render('work-info',[ return $this->render('work-info',[
'user_id' => $user_id 'user_id' => $user_id,
'date_begin' => $date_begin,
'date_end' => $date_end,
'date2_begin' => $date2_begin,
'date2_end' => $date2_end,
'username' => $username
]); ]);
} }
public function actionWorkInfoJson() public function actionWorkInfoJson()

@ -65,6 +65,11 @@ use \common\libs\MyLib;
sidePagination: 'server', sidePagination: 'server',
queryParams: function(params) { queryParams: function(params) {
o['user_id'] = '<?=$user_id?>'; o['user_id'] = '<?=$user_id?>';
o['date_begin'] = '<?=$date_begin?>';
o['date_end'] = '<?=$date_end?>';
o['date2_begin'] = '<?=$date2_begin?>';
o['date2_end'] = '<?=$date2_end?>';
o['username'] = '<?=$username?>';
o['offset'] = params['offset']; o['offset'] = params['offset'];
o['limit'] = params['limit']; o['limit'] = params['limit'];
return o; return o;

Loading…
Cancel
Save