您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

140 行
5.3 KiB

  1. <?php
  2. namespace backend\modules\zzcs\models;
  3. use yii\db\ActiveRecord;
  4. /**
  5. * This is the model class for table "bus_order".
  6. *
  7. * @property integer $id
  8. * @property integer $bus_number
  9. * @property integer $create_user_id
  10. * @property string $create_time
  11. * @property integer $update_user_id
  12. * @property string $update_time
  13. * @property integer $cancel_flag
  14. * @property integer $use_bus_org_id
  15. * @property string $run_date
  16. * @property integer $run_bus_id
  17. * @property integer $run_id
  18. * @property integer $line_id
  19. * @property string $start_time
  20. * @property integer $bus_order_id
  21. * @property integer $bus_type_res_id
  22. * @property integer $seat_count
  23. * @property integer $saled_count
  24. * @property integer $itinerary_id
  25. * @property string $itinerary_name
  26. * @property integer $line_type
  27. * @property integer $day_num
  28. * @property integer $bus_cost_type
  29. * @property string $bus_cost
  30. * @property string $remark
  31. * @property string $send_msg
  32. * @property integer $send_type
  33. * @property string $send_cost
  34. * @property integer $send_bus_res_id
  35. * @property integer $send_bus_driver_res_id
  36. * @property integer $send_status
  37. * @property integer $run_status
  38. * @property integer $finance_status
  39. * @property integer $end_status
  40. * @property integer $line_status
  41. * @property integer $safe
  42. *
  43. * @property BaseBus $sendBusRes
  44. * @property BaseDriver $sendBusDriverRes
  45. */
  46. class BusOrder extends ActiveRecord
  47. {
  48. /**
  49. * @inheritdoc
  50. */
  51. public static function tableName()
  52. {
  53. return 'bus_order';
  54. }
  55. /**
  56. * @inheritdoc
  57. */
  58. public function rules()
  59. {
  60. return [
  61. [['bus_number', 'create_user_id', 'update_user_id', 'run_date', 'seat_count', 'saled_count', 'send_type'], 'required'],
  62. [['bus_number', 'create_user_id', 'update_user_id', 'cancel_flag', 'use_bus_org_id', 'run_bus_id', 'run_id', 'line_id', 'bus_order_id', 'bus_type_res_id', 'seat_count', 'saled_count', 'itinerary_id', 'line_type', 'day_num', 'bus_cost_type', 'send_type', 'send_bus_res_id', 'send_bus_driver_res_id', 'send_status', 'run_status', 'finance_status', 'end_status', 'line_status', 'safe'], 'integer'],
  63. [['update_time'], 'safe'],
  64. [['bus_cost', 'send_cost'], 'number'],
  65. [['create_time'], 'string', 'max' => 20],
  66. [['run_date'], 'string', 'max' => 10],
  67. [['start_time'], 'string', 'max' => 128],
  68. [['itinerary_name'], 'string', 'max' => 50],
  69. [['remark'], 'string', 'max' => 100],
  70. [['send_msg'], 'string', 'max' => 1024],
  71. [['send_bus_res_id'], 'exist', 'skipOnError' => true, 'targetClass' => BaseBus::className(), 'targetAttribute' => ['send_bus_res_id' => 'BUS_ID']],
  72. [['send_bus_driver_res_id'], 'exist', 'skipOnError' => true, 'targetClass' => BaseDriver::className(), 'targetAttribute' => ['send_bus_driver_res_id' => 'DRIVER_ID']],
  73. ];
  74. }
  75. /**
  76. * @inheritdoc
  77. */
  78. public function attributeLabels()
  79. {
  80. return [
  81. 'id' => '主键,自增',
  82. 'bus_number' => '出车单号',
  83. 'create_user_id' => 'Create User ID',
  84. 'create_time' => 'Create Time',
  85. 'update_user_id' => 'Update User ID',
  86. 'update_time' => '记录最后更新时间',
  87. 'cancel_flag' => 'Cancel Flag',
  88. 'use_bus_org_id' => '用车单位',
  89. 'run_date' => '用车日期',
  90. 'run_bus_id' => '车次ID,对应run_bus中的主键ID,用于派车时更新巴士系统车次库存',
  91. 'run_id' => '班次ID,供同步已有班次使用',
  92. 'line_id' => '线路ID,供同步数据使用',
  93. 'start_time' => 'Start Time',
  94. 'bus_order_id' => '车次号,供同步已有车次使用',
  95. 'bus_type_res_id' => '用车类型',
  96. 'seat_count' => '车座数',
  97. 'saled_count' => '乘客人数',
  98. 'itinerary_id' => '行程ID',
  99. 'itinerary_name' => '行程名称',
  100. 'line_type' => '行程类型,市内或省际 1为省际,2为市内',
  101. 'day_num' => '行程包含的行程天数',
  102. 'bus_cost_type' => '车辆计价方式 477为包车计价,478为人数计价',
  103. 'bus_cost' => '车辆计价金额',
  104. 'remark' => '用车备注',
  105. 'send_msg' => '调度原因等调度时候的信息',
  106. 'send_type' => '内部派车还是外部派车 0:内部 1:外部',
  107. 'send_cost' => '调派车辆时的价格',
  108. 'send_bus_res_id' => '调派车辆res_id',
  109. 'send_bus_driver_res_id' => '调派司机res_id',
  110. 'send_status' => '调度状态',
  111. 'run_status' => '出车状态',
  112. 'finance_status' => '报账状态',
  113. 'end_status' => '结算状态',
  114. 'line_status' => '线路牌 0为未亮起 1为亮起',
  115. 'safe' => '安检 0为未安检 1为已安检',
  116. ];
  117. }
  118. /**
  119. * @return \yii\db\ActiveQuery
  120. */
  121. public function getSendBusRes()
  122. {
  123. return $this->hasOne(BaseBus::className(), ['BUS_ID' => 'send_bus_res_id']);
  124. }
  125. /**
  126. * @return \yii\db\ActiveQuery
  127. */
  128. public function getSendBusDriverRes()
  129. {
  130. return $this->hasOne(BaseDriver::className(), ['DRIVER_ID' => 'send_bus_driver_res_id']);
  131. }
  132. }