<?php namespace app\api\model; use think\Model; class Category extends Model { // 自动写入时间戳字段 protected $autoWriteTimestamp = 'int'; protected $name = 'litestore_category'; protected $createTime = 'createtime'; protected $updateTime = 'updatetime'; protected $append = [ 'image_text' ]; public function getImageTextAttr($value,$data) { $value = empty($data['image'])?'':cdnurl($data['image'],true); return $value; } }