This commit is contained in:
2026-01-05 16:15:27 +08:00
parent 8470fdc2a9
commit cc5fe0bcaa
2 changed files with 33 additions and 8 deletions
+14
View File
@@ -5,6 +5,8 @@ namespace app\common\service;
use app\common\validate\UsedCarValidate;
use app\common\traits\crud\CrudServiceTrait;
use app\common\model\UsedCar;
use support\exception\BusinessException;
use support\Request;
class UsedCarService
{
@@ -28,4 +30,16 @@ class UsedCarService
{
return new $this->validator;
}
public function beforeServiceStore($data, Request $request): array
{
if(empty($data['product_name'])){
throw new BusinessException('产品名称不能为空');
}
if(empty($data['images'])){
throw new BusinessException('产品图片不能为空');
}
return $data;
}
}