You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

72 lines
1.7 KiB

  1. <?php
  2. namespace backend\modules\hotel\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "order_ht_exception_list".
  6. *
  7. * @property integer $ID
  8. * @property integer $create_user_id
  9. * @property string $create_time
  10. * @property integer $order_id
  11. * @property integer $status
  12. * @property string $msg
  13. */
  14. class OrderHtExceptionList extends \yii\db\ActiveRecord
  15. {
  16. CONST AGREE_CANCEL = 1;
  17. CONST REFUSE_CANCEL = 2;
  18. CONST WHITE_ARRAY = [
  19. self::AGREE_CANCEL => '同意取消',
  20. self::REFUSE_CANCEL => '拒绝取消',
  21. ];
  22. /**
  23. * @inheritdoc
  24. */
  25. public static function tableName()
  26. {
  27. return 'order_ht_exception_list';
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['create_user_id', 'order_id', 'status'], 'integer'],
  36. [['create_time'], 'safe'],
  37. [['order_id'], 'required'],
  38. [['msg'], 'string', 'max' => 255],
  39. ];
  40. }
  41. /**
  42. * @inheritdoc
  43. */
  44. public function attributeLabels()
  45. {
  46. return [
  47. 'ID' => Yii::t('app', 'ID'),
  48. 'create_user_id' => Yii::t('app', '记录创建人'),
  49. 'create_time' => Yii::t('app', '创建时间'),
  50. 'order_id' => Yii::t('app', '订单号'),
  51. 'status' => Yii::t('app', '处理后的状态 1:同意取消 2:拒绝取消'),
  52. 'msg' => Yii::t('app', '备注信息'),
  53. ];
  54. }
  55. public function beforeSave($insert)
  56. {
  57. if ($this->isNewRecord) {
  58. $this->create_time = date('Y-m-d H:i:s', time());
  59. $this->create_user_id = Yii::$app->user->id;
  60. }
  61. return parent::beforeSave($insert);
  62. }
  63. }