修改图片字段的错误

This commit is contained in:
lewis 2025-03-17 15:33:03 +08:00
parent a9ae0ede08
commit 6475df1d71

View File

@ -18,7 +18,7 @@ class BaseModel extends Model
*/
public function getImageAttr($value)
{
return trim($value) ? FileService::getFileUrl($value) : '';
return empty($value) ? '' : (trim($value) ? FileService::getFileUrl($value) : '');
}
/**
@ -30,7 +30,7 @@ class BaseModel extends Model
*/
public function setImageAttr($value)
{
return trim($value) ? FileService::setFileUrl($value) : '';
return empty($value) ? '' : (trim($value) ? FileService::setFileUrl($value) : '');
}
/**