|
- <?php
-
- namespace backend\modules\hotel\models;
-
- use common\models\zModel;
-
- /**
- * This is the model class for table "order_channel_info".
- *
- * @property integer $ORDER_ID
- * @property string $InterFaceSendID
- * @property string $UPDATE_TIME
- * @property integer $CANCEL_FLAG\
- * @property string $channel_order_id
- */
- class OrderChannelInfo extends zModel
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'order_channel_info';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['ORDER_ID', 'InterFaceSendID'], 'required'],
- [['ORDER_ID', 'CANCEL_FLAG'], 'integer'],
- [['UPDATE_TIME'], 'safe'],
- [['InterFaceSendID'], 'string', 'max' => 100],
- [['channel_order_id'], 'string', 'max' => 20],
- [['channel_order_id'], 'required', 'on' => ['error_order']],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'ORDER_ID' => '订单号',
- 'InterFaceSendID' => '渠道订单接口发送号',
- 'UPDATE_TIME' => '更新时间',
- 'CANCEL_FLAG' => '记录有效性标记,CANCEL_FLAG=0记录有效;CANCEL_FLAG=1,记录已删除\'',
- 'channel_order_id' => '渠道单号',
- ];
- }
-
- public function beforeSave($insert)
- {
- if ($this->isNewRecord) {
- $this->CANCEL_FLAG = 0;
- }
- return parent::beforeSave($insert);
- }
- }
|