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.
 
 
 
 
 
 

63 lines
1.5 KiB

  1. <?php
  2. namespace backend\modules\hotel\models;
  3. use common\models\zModel;
  4. /**
  5. * This is the model class for table "order_channel_info".
  6. *
  7. * @property integer $ORDER_ID
  8. * @property string $InterFaceSendID
  9. * @property string $UPDATE_TIME
  10. * @property integer $CANCEL_FLAG\
  11. * @property string $channel_order_id
  12. */
  13. class OrderChannelInfo extends zModel
  14. {
  15. /**
  16. * @inheritdoc
  17. */
  18. public static function tableName()
  19. {
  20. return 'order_channel_info';
  21. }
  22. /**
  23. * @inheritdoc
  24. */
  25. public function rules()
  26. {
  27. return [
  28. [['ORDER_ID', 'InterFaceSendID'], 'required'],
  29. [['ORDER_ID', 'CANCEL_FLAG'], 'integer'],
  30. [['UPDATE_TIME'], 'safe'],
  31. [['InterFaceSendID'], 'string', 'max' => 100],
  32. [['channel_order_id'], 'string', 'max' => 20],
  33. [['channel_order_id'], 'required', 'on' => ['error_order']],
  34. ];
  35. }
  36. /**
  37. * @inheritdoc
  38. */
  39. public function attributeLabels()
  40. {
  41. return [
  42. 'ORDER_ID' => '订单号',
  43. 'InterFaceSendID' => '渠道订单接口发送号',
  44. 'UPDATE_TIME' => '更新时间',
  45. 'CANCEL_FLAG' => '记录有效性标记,CANCEL_FLAG=0记录有效;CANCEL_FLAG=1,记录已删除\'',
  46. 'channel_order_id' => '渠道单号',
  47. ];
  48. }
  49. public function beforeSave($insert)
  50. {
  51. if ($this->isNewRecord) {
  52. $this->CANCEL_FLAG = 0;
  53. }
  54. return parent::beforeSave($insert);
  55. }
  56. }