12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\common\model;
- use think\Db;
- use think\Model;
- /**
- * 群组
- */
- class HotelCanteenModel extends Model
- {
- // 表名
- protected $name = 'hotel_canteen';
- // 开启自动写入时间戳字段
- protected $autoWriteTimestamp = false;
- // 定义时间戳字段名
- protected $createTime = false;
- protected $updateTime = false;
- protected $deleteTime = false;
- 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 room()
- {
- return $this->hasOne(HotelCanteenRoomModel::class, 'canteen_id', 'id');
- }
- }
|