123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace app\common\model;
- use think\Db;
- use think\Model;
- /**
- * 群组
- */
- class HotelCanteenOrderModel extends Model
- {
- // 表名
- protected $name = 'hotel_canteen_order';
- // 开启自动写入时间戳字段
- 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 canteen()
- {
- return $this->hasOne(HotelCanteenModel::class, 'id', 'canteen_id');
- }
- public function room()
- {
- return $this->hasOne(HotelCanteenRoomModel::class, 'id', 'room_id');
- }
- }
|