72 linhas
1.7 KiB

  1. <?php
  2. namespace backend\modules\motorcade\models;
  3. use backend\modules\zzcs\models\BaseUser;
  4. use Yii;
  5. /**
  6. * This is the model class for table "bus_action_log".
  7. *
  8. * @property integer $id
  9. * @property string $route
  10. * @property string $description
  11. * @property integer $bus_order_id
  12. * @property integer $type
  13. * @property string $msg
  14. * @property string $attributes
  15. * @property string $values
  16. * @property string $old_values
  17. * @property integer $created_at
  18. * @property integer $user_id
  19. */
  20. class BusActionLog extends \yii\db\ActiveRecord
  21. {
  22. /**
  23. * @inheritdoc
  24. */
  25. public static function tableName()
  26. {
  27. return 'bus_action_log';
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['description', 'bus_order_id', 'type'], 'required'],
  36. [['description'], 'string'],
  37. [['bus_order_id', 'type', 'user_id'], 'integer'],
  38. [['route', 'attributes', 'values', 'old_values'], 'string', 'max' => 255],
  39. [['msg'], 'string', 'max' => 1024],
  40. ];
  41. }
  42. /**
  43. * @inheritdoc
  44. */
  45. public function attributeLabels()
  46. {
  47. return [
  48. 'id' => 'ID',
  49. 'route' => 'Route',
  50. 'description' => 'Description',
  51. 'bus_order_id' => 'Bus Order ID',
  52. 'type' => 'Type',
  53. 'msg' => 'Msg',
  54. 'attributes' => 'Attributes',
  55. 'values' => 'Values',
  56. 'old_values' => 'Old Values',
  57. 'created_at' => 'Created At',
  58. 'user_id' => 'User ID',
  59. ];
  60. }
  61. public function getUser()
  62. {
  63. return $this->hasOne(BaseUser::tableName(), ['ID' => 'user_id']);
  64. }
  65. }