解决续保标志报错BUG

dev
曾超新 5 years ago
parent 87f0d1952d
commit 9df4895062
  1. 6
      frontend/controllers/DatabaseController.php

@ -285,7 +285,7 @@ class DatabaseController extends BaseController
$car_info = CarT::findOne(['id'=>$id]); $car_info = CarT::findOne(['id'=>$id]);
if($car_info->location == 1) { if($car_info->location == 1) {
$car_info->location = 2; $car_info->location = 2;
$car_info->xubao_num = 0; $car_info->is_xubao = 0;
if(!$car_info->save(false)) { if(!$car_info->save(false)) {
throw new Exception(print_r($car_info->getFirstErrors(),true)); throw new Exception(print_r($car_info->getFirstErrors(),true));
} }
@ -333,7 +333,7 @@ class DatabaseController extends BaseController
foreach($query->each(1000) as $car_info) { foreach($query->each(1000) as $car_info) {
if($car_info->location == 1) { if($car_info->location == 1) {
$car_info->location = 2; $car_info->location = 2;
$car_info->xubao_num = 0; $car_info->is_xubao = 0;
if(!$car_info->save(false)) { if(!$car_info->save(false)) {
throw new Exception(print_r($car_info->getFirstErrors(),true)); throw new Exception(print_r($car_info->getFirstErrors(),true));
} }
@ -383,7 +383,7 @@ class DatabaseController extends BaseController
$car_info = CarT::findOne(['id'=>$id]); $car_info = CarT::findOne(['id'=>$id]);
if($car_info->location == 1) { if($car_info->location == 1) {
$car_info->location = 3; $car_info->location = 3;
$car_info->xubao_num = 1; $car_info->is_xubao = 1;
if(!$car_info->save(false)) { if(!$car_info->save(false)) {
throw new Exception(print_r($car_info->getFirstErrors(),true)); throw new Exception(print_r($car_info->getFirstErrors(),true));
} }

Loading…
Cancel
Save