__('Is_cool 0'), '1' => __('Is_cool 1')]; } public function getRoomTypeList() { return ['1' => __('Room_type 1'), '2' => __('Room_type 2')]; } public function getIsOnlineList() { return ['1' => __('Is_online 1'), '0' => __('Is_online 0')]; } public function getStatusList() { return ['-1' => __('Status -1'), '1' => __('Status 1')]; } public function getIsRecommendList() { return ['1' => __('Is_recommend 1'), '0' => __('Is_recommend 0')]; } public function getIsCloseList() { return ['1' => __('Is_close 1'), '0' => __('Is_close 0')]; } public function getIsScreenList() { return ['1' => __('Is_screen 1'), '0' => __('Is_screen 0')]; } public function getOnModelList() { return ['1' => __('On_model 1'), '2' => __('On_model 2')]; } public function getIsCoolTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_cool']) ? $data['is_cool'] : ''); $list = $this->getIsCoolList(); return isset($list[$value]) ? $list[$value] : ''; } public function getRoomTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['room_type']) ? $data['room_type'] : ''); $list = $this->getRoomTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsOnlineTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_online']) ? $data['is_online'] : ''); $list = $this->getIsOnlineList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsRecommendTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_recommend']) ? $data['is_recommend'] : ''); $list = $this->getIsRecommendList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsScreenTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_screen']) ? $data['is_screen'] : ''); $list = $this->getIsScreenList(); return isset($list[$value]) ? $list[$value] : ''; } public function getOnModelTextAttr($value, $data) { $value = $value ? $value : (isset($data['on_model']) ? $data['on_model'] : ''); $list = $this->getOnModelList(); return isset($list[$value]) ? $list[$value] : ''; } public function user() { return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } //关联派对类型表 public function partyType() { return $this->hasOne(Type::class, 'id', 'party_type',[],'LEFT'); } }