|
|
@ -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)); |
|
|
|
} |
|
|
|
} |
|
|
|