// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\api\model; use think\model\relation\BelongsTo; use app\common\model\CommentImage as CommentImageModel; /** * 商品图片模型 * Class GoodsImage * @package app\api\model */ class CommentImage extends CommentImageModel { /** * 隐藏字段 * @var array */ protected $hidden = [ 'store_id', 'create_time', ]; /** * 关联文件库 * @return BelongsTo */ public function file(): BelongsTo { return parent::file()->bind(['image_url' => 'preview_url']); } }