|
- <?php
-
- namespace backend\modules\api\models;
-
- use Yii;
-
- /**
- * This is the model class for table "opera_hotel_base_room".
- *
- * @property integer $MAIN_ID
- * @property string $CREATE_TIME
- * @property integer $CREATE_USER_ID
- * @property string $UPDATE_TIME
- * @property integer $CANCEL_FLAG
- * @property integer $HOTEL_ID
- * @property integer $BASE_ROOM_TYPE
- * @property string $BASE_ROOM_NAME
- */
- class OperaHotelBaseRoom extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'opera_hotel_base_room';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['CREATE_USER_ID', 'CANCEL_FLAG', 'HOTEL_ID', 'BASE_ROOM_TYPE'], 'integer'],
- [['CREATE_TIME', 'UPDATE_TIME', 'BASE_ROOM_NAME'], 'string', 'max' => 50],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'MAIN_ID' => 'Main ID',
- 'CREATE_TIME' => 'Create Time',
- 'CREATE_USER_ID' => 'Create User ID',
- 'UPDATE_TIME' => 'Update Time',
- 'CANCEL_FLAG' => 'Cancel Flag',
- 'HOTEL_ID' => 'Hotel ID',
- 'BASE_ROOM_TYPE' => 'Base Room Type',
- 'BASE_ROOM_NAME' => 'Base Room Name',
- ];
- }
-
- /**
- * Function Description:判断该酒店基础房型是否被删
- * Function Name: getOperaHotelBaseRoom
- * @param $model
- *
- * @return static
- *
- * @author LUOCJ
- */
- public static function getOperaHotelBaseRoom($model)
- {
- $res = OperaHotelBaseRoom::findOne(['hotel_id' => $model->extra_res_info, 'cancel_flag' => 0, 'base_room_type' => $model->top_res_id]);
- return $res;
- }
- }
|