12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace app\modules\car\models;
- use Yii;
- /**
- * This is the model class for table "{{%f_car_info}}".
- *
- * @property int $car_id
- * @property string $card_num 车牌号
- * @property string|null $city 地市
- * @property string|null $dpt_sec 二级单位
- * @property string|null $grid 网格
- * @property string|null $factory 厂家
- * @property int|null $passengers 载客人数
- * @property string|null $model 型号
- * @property float|null $emissions 排量
- * @property string|null $car_type 车辆类型
- * @property string|null $enabled_date 启用日期
- * @property string|null $using_tag 用途分类
- * @property string|null $asset_id 资产编号
- * @property string|null $self_rent 产权
- * @property string|null $rps_dpt 责任部门
- * @property string|null $rps_man 责任人
- * @property int|null $cell_num 电话号码
- */
- class FCarInfo extends \app\common\models\EActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%f_car_info}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['card_num'], 'required'],
- [['passengers', 'cell_num'], 'integer'],
- [['emissions'], 'number'],
- [['enabled_date'], 'safe'],
- [['card_num', 'city', 'dpt_sec', 'grid', 'factory', 'model', 'car_type', 'using_tag', 'asset_id', 'self_rent', 'rps_dpt', 'rps_man'], 'string', 'max' => 63],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'car_id' => 'Car ID',
- 'card_num' => '车牌号',
- 'city' => '地市',
- 'dpt_sec' => '二级单位',
- 'grid' => '网格',
- 'factory' => '厂家',
- 'passengers' => '载客人数',
- 'model' => '型号',
- 'emissions' => '排量',
- 'car_type' => '车辆类型',
- 'enabled_date' => '启用日期',
- 'using_tag' => '用途分类',
- 'asset_id' => '资产编号',
- 'self_rent' => '产权',
- 'rps_dpt' => '责任部门',
- 'rps_man' => '责任人',
- 'cell_num' => '电话号码',
- ];
- }
- public function getCartable()
- {
- return FOneCarOneTable::find()->where("car_id=$this->car_id")->orderBy(['id'=>SORT_DESC])->limit(1)->one();
- }
- }
|