init
This commit is contained in:
67
models/Logs.php
Normal file
67
models/Logs.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?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ố"
|
||||
];
|
||||
}
|
||||
|
||||
public function getVehicle() {
|
||||
return $this->hasOne(Vehicle::className(), ["id" => "vehicle_id"]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user