产品
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user