73 lines
1.9 KiB
PHP
73 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace app\models;
|
|
|
|
use Yii;
|
|
|
|
/**
|
|
* This is the model class for table "logs".
|
|
*
|
|
* @property int $id
|
|
* @property int $vehicle_id
|
|
* @property string $plate_image_in
|
|
* @property string $frame_image_in
|
|
* @property int $time_in
|
|
* @property string $plate_image_out
|
|
* @property string $frame_image_out
|
|
* @property int $time_out
|
|
* @property string $seal_no
|
|
* @property string $note
|
|
* @property string $factory
|
|
*/
|
|
class Logs extends \yii\db\ActiveRecord {
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function tableName() {
|
|
return 'logs';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function rules() {
|
|
return [
|
|
[['vehicle_id'], 'required'],
|
|
[['vehicle_id', 'time_in', 'time_out'], 'integer'],
|
|
[['plate_image_in', 'frame_image_in', 'plate_image_out', 'frame_image_out', 'seal_no', 'note'], 'string'],
|
|
[['factory'], 'string', 'max' => 100],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function attributeLabels() {
|
|
return [
|
|
'id' => 'ID',
|
|
'vehicle_id' => 'Vehicle ID',
|
|
'plate_image_in' => 'Ảnh biển vào',
|
|
'frame_image_in' => 'Frame Image In',
|
|
'time_in' => 'Thời gian vào',
|
|
'plate_image_out' => 'Ảnh biển ra',
|
|
'frame_image_out' => 'Frame Image Out',
|
|
'time_out' => 'Thời gian ra',
|
|
'seal_no' => 'SEAL_NO',
|
|
'note' => 'Nội dung khác',
|
|
'factory' => 'Factory',
|
|
'plate' => "Biển số",
|
|
'type' => "Loại xe",
|
|
'company' => "Tên công ty",
|
|
'driver' => "Lái xe",
|
|
'telephone' => "Điện thoại",
|
|
'cmt' => "CMT"
|
|
];
|
|
}
|
|
|
|
public function getVehicle() {
|
|
return $this->hasOne(Vehicle::className(), ["id" => "vehicle_id"]);
|
|
}
|
|
|
|
}
|