1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\common\model;
- use app\api\controller\Hotel;
- use think\Db;
- use think\Model;
- /**
- * 群组
- */
- class HotelRoomModel extends Model
- {
- // 表名
- protected $name = 'hotel_room';
- // 开启自动写入时间戳字段
- protected $autoWriteTimestamp = false;
- // 定义时间戳字段名
- protected $createTime = false;
- protected $updateTime = false;
- protected $deleteTime = false;
- public function getWifiPhoneAttr($value, $data)
- {
- return explode(',',$value);
- }
- public function getRoomLayoutAttr($value, $data)
- {
- return explode(',',$value);
- }
- public function getWashUseAttr($value, $data)
- {
- return explode(',',$value);
- }
- public function getFacilityAttr($value, $data)
- {
- return explode(',',$value);
- }
- public function getBathroomAttr($value, $data)
- {
- return explode(',',$value);
- }
- public function getImageAttr($value, $data)
- {
- return cdnurl($value);
- }
- public function getImagesAttr($value, $data)
- {
- $value = explode(',',$value);
- foreach ($value as &$v){
- $v = cdnurl($v);
- }
- return $value;
- }
- public function hotel()
- {
- return $this->hasOne(HotelModel::class, 'id', 'hotel_id');
- }
- }
|