dev
曾超新 5 years ago
parent b8b1844b96
commit d703b7c4b5
  1. 15
      common/models/CarT.php
  2. 68
      frontend/controllers/CarController.php

@ -21,13 +21,9 @@ use Yii;
* @property string $id_number * @property string $id_number
* @property string $engine_no * @property string $engine_no
* @property string $car_frame_no * @property string $car_frame_no
* @property integer $brand_id
* @property integer $series_id
* @property integer $displacement_id
* @property string $car_year
* @property integer $seats * @property integer $seats
* @property string $car_man * @property string $car_man
* @property string $phone * @property string $car_man_phone
* @property string $weixin * @property string $weixin
* @property string $remark * @property string $remark
* @property integer $location * @property integer $location
@ -48,9 +44,6 @@ use Yii;
*/ */
class CarT extends \common\models\Base class CarT extends \common\models\Base
{ {
const MONTH = [1,2,3,4,5,6,7,8,9,10,11,12];
const DAYS = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
/** /**
* @inheritdoc * @inheritdoc
*/ */
@ -66,7 +59,7 @@ class CarT extends \common\models\Base
{ {
return [ return [
[['user_id'], 'required'], [['user_id'], 'required'],
[['user_id', 'car_type_id', 'car_use_id','seats','brand_id','series_id','displacement_id','location','invalid_id','invalid_flag','is_track','times','biaozhu','hiddenes'], 'integer'], [['user_id', 'car_type_id', 'car_use_id','seats','location','invalid_id','invalid_flag','is_track','times','biaozhu','hiddenes'], 'integer'],
[['register_date', 'insurer1_date', 'insurer2_date','id_man','id_number','print_date','car_man_number', 'created_at', 'updated_at'], 'safe'], [['register_date', 'insurer1_date', 'insurer2_date','id_man','id_number','print_date','car_man_number', 'created_at', 'updated_at'], 'safe'],
[['car_no', 'factory_model', 'car_model', 'engine_no', 'car_frame_no','old_user','phone1','id_phone'], 'string', 'max' => 50], [['car_no', 'factory_model', 'car_model', 'engine_no', 'car_frame_no','old_user','phone1','id_phone'], 'string', 'max' => 50],
[['car_year'], 'string', 'max' => 10], [['car_year'], 'string', 'max' => 10],
@ -94,10 +87,6 @@ class CarT extends \common\models\Base
'id_number' => 'ID Number', 'id_number' => 'ID Number',
'engine_no' => 'Engine No', 'engine_no' => 'Engine No',
'car_frame_no' => 'Car Frame No', 'car_frame_no' => 'Car Frame No',
'brand_id' => 'Brand ID',
'series_id' => 'Series ID',
'displacement_id' => 'Displacement ID',
'car_year' => 'Car Year',
'seats' => 'Seats', 'seats' => 'Seats',
'car_man' => 'Car Man', 'car_man' => 'Car Man',
'phone' => 'Phone', 'phone' => 'Phone',

@ -780,17 +780,6 @@ class CarController extends BaseController
$car_use_items = CarUseT::find()->all(); $car_use_items = CarUseT::find()->all();
// 车辆类型 // 车辆类型
$car_type_items = CarTypeT::find()->all(); $car_type_items = CarTypeT::find()->all();
// 品牌信息
$brand_items = BrandT::find()->all();
// 车系信息
$series_items = SeriesT::find()
->where('brand_id='.intval($car_info->brand_id))
->all();
// 排量信息
$displacement_items = DisplacementT::find()
->where('series_id='.intval($car_info->series_id))
->all();
// $failure_items = InvalidT::getTree(2);
// 无效数据 // 无效数据
$failure_items = InvalidT::getTrees(); $failure_items = InvalidT::getTrees();
@ -916,9 +905,6 @@ class CarController extends BaseController
'sort_value' => $sort_value, 'sort_value' => $sort_value,
'car_use_items' => $car_use_items, 'car_use_items' => $car_use_items,
'car_type_items' => $car_type_items, 'car_type_items' => $car_type_items,
'brand_items' => $brand_items,
'series_items' => $series_items,
'displacement_items' => $displacement_items,
'back_params' => $back_params, 'back_params' => $back_params,
'business_group' => $business_group, 'business_group' => $business_group,
'adid' => $aid, 'adid' => $aid,
@ -943,13 +929,6 @@ class CarController extends BaseController
$car_use_items = CarUseT::find()->all(); $car_use_items = CarUseT::find()->all();
$car_type_items = CarTypeT::find()->all(); $car_type_items = CarTypeT::find()->all();
$brand_items = BrandT::find()->all();
$series_items = SeriesT::find()
->where('brand_id='.intval($car_info->brand_id))
->all();
$displacement_items = DisplacementT::find()
->where('series_id='.intval($car_info->series_id))
->all();
$failure_items = InvalidT::getTree(2); $failure_items = InvalidT::getTree(2);
//新礼品 //新礼品
@ -1074,9 +1053,6 @@ class CarController extends BaseController
'sort_value' => $sort_value, 'sort_value' => $sort_value,
'car_use_items' => $car_use_items, 'car_use_items' => $car_use_items,
'car_type_items' => $car_type_items, 'car_type_items' => $car_type_items,
'brand_items' => $brand_items,
'series_items' => $series_items,
'displacement_items' => $displacement_items,
'back_params' => $back_params, 'back_params' => $back_params,
'business_group' => $business_group, 'business_group' => $business_group,
'business_group_id' => $business_group_id, 'business_group_id' => $business_group_id,
@ -1133,13 +1109,6 @@ class CarController extends BaseController
$pay_type_items = PayTypeT::find()->all(); $pay_type_items = PayTypeT::find()->all();
$car_use_items = CarUseT::find()->all(); $car_use_items = CarUseT::find()->all();
$car_type_items = CarTypeT::find()->all(); $car_type_items = CarTypeT::find()->all();
$brand_items = BrandT::find()->all();
$series_items = SeriesT::find()
->where('brand_id='.intval($car_info->brand_id))
->all();
$displacement_items = DisplacementT::find()
->where('series_id='.intval($car_info->series_id))
->all();
$direction_items = DirectionT::find() $direction_items = DirectionT::find()
->all(); ->all();
$range_items = RangeT::find() $range_items = RangeT::find()
@ -1320,9 +1289,6 @@ class CarController extends BaseController
'pay_type_items' => $pay_type_items, 'pay_type_items' => $pay_type_items,
'car_use_items' => $car_use_items, 'car_use_items' => $car_use_items,
'car_type_items' => $car_type_items, 'car_type_items' => $car_type_items,
'brand_items' => $brand_items,
'series_items' => $series_items,
'displacement_items' => $displacement_items,
'direction_items' => $direction_items, 'direction_items' => $direction_items,
'range_items' => $range_items, 'range_items' => $range_items,
'city_items' => $city_items, 'city_items' => $city_items,
@ -1405,13 +1371,6 @@ class CarController extends BaseController
$pay_type_items = PayTypeT::find()->all(); $pay_type_items = PayTypeT::find()->all();
$car_use_items = CarUseT::find()->all(); $car_use_items = CarUseT::find()->all();
$car_type_items = CarTypeT::find()->all(); $car_type_items = CarTypeT::find()->all();
$brand_items = BrandT::find()->all();
$series_items = SeriesT::find()
->where('brand_id='.intval($car_info->brand_id))
->all();
$displacement_items = DisplacementT::find()
->where('series_id='.intval($car_info->series_id))
->all();
$direction_items = DirectionT::find() $direction_items = DirectionT::find()
->all(); ->all();
$range_items = RangeT::find() $range_items = RangeT::find()
@ -1579,9 +1538,6 @@ class CarController extends BaseController
'pay_type_items' => $pay_type_items, 'pay_type_items' => $pay_type_items,
'car_use_items' => $car_use_items, 'car_use_items' => $car_use_items,
'car_type_items' => $car_type_items, 'car_type_items' => $car_type_items,
'brand_items' => $brand_items,
'series_items' => $series_items,
'displacement_items' => $displacement_items,
'direction_items' => $direction_items, 'direction_items' => $direction_items,
'range_items' => $range_items, 'range_items' => $range_items,
'city_items' => $city_items, 'city_items' => $city_items,
@ -1622,35 +1578,11 @@ class CarController extends BaseController
$car_use_items = CarUseT::find()->all(); $car_use_items = CarUseT::find()->all();
$car_type_items = CarTypeT::find()->all(); $car_type_items = CarTypeT::find()->all();
$brand_items = BrandT::find()->all();
$factory_items = FactoryT::find()
->where('brand_id='.intval($info->brand_id))
->all();
$series_items = SeriesT::find()
->where('factory_id='.intval($info->factory_id))
->all();
$displacement_items = DisplacementT::find()
->where('series_id='.intval($info->series_id))
->all();
$year_items = YearT::find()
->where('series_id='.intval($info->series_id.' and displacement_id='.intval($info->displacement_id)))
->all();
$model_items = ModelT::find()
->where('series_id='.intval($info->series_id))
->andWhere('displacement_id='.intval($info->displacement_id))
->andWhere('year_id='.intval($info->year_id))
->all();
return $this->render('info-edit',[ return $this->render('info-edit',[
'info' => $info, 'info' => $info,
'car_use_items' => $car_use_items, 'car_use_items' => $car_use_items,
'car_type_items' => $car_type_items, 'car_type_items' => $car_type_items,
'brand_items' => $brand_items,
'factory_items' => $factory_items,
'series_items' => $series_items,
'displacement_items' => $displacement_items,
'year_items' => $year_items,
'model_items' => $model_items
]); ]);
} }

Loading…
Cancel
Save