|
- <?php
-
- namespace backend\modules\api\models;
-
- use Yii;
-
- /**
- * This is the model class for table "opera_tourist_detail".
- *
- * @property integer $id
- * @property integer $tourist_id
- * @property integer $create_user_id
- * @property string $create_time
- * @property integer $update_user_id
- * @property string $update_time
- * @property integer $cancel_flag
- * @property integer $res_type
- * @property integer $top_res_id
- * @property integer $sub_res_id
- * @property integer $sub_res_id1
- * @property string $select_res_ids
- * @property string $select_res_ids1
- * @property string $extra_res_info
- * @property string $crowd_type
- * @property integer $max_num
- * @property integer $day_from_start
- * @property integer $serial_id
- */
- class OperaTouristDetail extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'opera_tourist_detail';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['tourist_id', 'create_user_id', 'update_user_id', 'cancel_flag', 'res_type', 'top_res_id', 'sub_res_id', 'sub_res_id1', 'max_num', 'day_from_start', 'serial_id'], 'integer'],
- [['create_time', 'update_time'], 'required'],
- [['create_time', 'update_time'], 'safe'],
- [['select_res_ids', 'select_res_ids1'], 'string', 'max' => 255],
- [['extra_res_info'], 'string', 'max' => 50],
- [['crowd_type'], 'string', 'max' => 2],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'tourist_id' => 'Tourist ID',
- 'create_user_id' => 'Create User ID',
- 'create_time' => 'Create Time',
- 'update_user_id' => 'Update User ID',
- 'update_time' => 'Update Time',
- 'cancel_flag' => 'Cancel Flag',
- 'res_type' => 'Res Type',
- 'top_res_id' => 'Top Res ID',
- 'sub_res_id' => 'Sub Res ID',
- 'sub_res_id1' => 'Sub Res Id1',
- 'select_res_ids' => 'Select Res Ids',
- 'select_res_ids1' => 'Select Res Ids1',
- 'extra_res_info' => 'Extra Res Info',
- 'crowd_type' => 'Crowd Type',
- 'max_num' => 'Max Num',
- 'day_from_start' => 'Day From Start',
- 'serial_id' => 'Serial ID',
- ];
- }
-
- public static function getOperaTouristDetailAll($tourist_id)
- {
- $data = self::findAll(['tourist_id' => $tourist_id, 'cancel_flag' => 0]);
- return $data;
- }
- }
|