refactor: 修改产品验证器
This commit is contained in:
@@ -28,6 +28,7 @@ class ProductValidate extends Validate
|
||||
'is_sale' => 'in:0,1',
|
||||
'is_new' => 'in:0,1',
|
||||
'is_hot' => 'in:0,1',
|
||||
'is_show' => 'in:0,1',
|
||||
'sort' => 'integer',
|
||||
'detail' => 'max:65535',
|
||||
'status' => 'in:-1,1',
|
||||
@@ -62,9 +63,10 @@ class ProductValidate extends Validate
|
||||
'desc.max' => '描述不能超过255个字符',
|
||||
'video_img.max' => '视频封面图不能超过255个字符',
|
||||
'video_url.max' => '视频地址不能超过255个字符',
|
||||
'is_sale.in' => '上架状态值错误',
|
||||
'is_sale.in' => '在售状态值错误',
|
||||
'is_new.in' => '新品状态值错误',
|
||||
'is_hot.in' => '热门状态值错误',
|
||||
'is_show.in' => '上下架状态值错误',
|
||||
'sort.integer' => '排序值类型错误',
|
||||
'detail.max' => '详情不能超过65535个字符',
|
||||
'status.in' => '状态值错误',
|
||||
@@ -86,7 +88,7 @@ class ProductValidate extends Validate
|
||||
*/
|
||||
public function sceneIndex()
|
||||
{
|
||||
return $this->only(['created_id', 'is_sale', 'created_at']);
|
||||
return $this->only(['categroy_id', 'is_show', 'created_at']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,6 +109,7 @@ class ProductValidate extends Validate
|
||||
'is_sale',
|
||||
'is_new',
|
||||
'is_hot',
|
||||
'is_show',
|
||||
'sort',
|
||||
'detail',
|
||||
'status',
|
||||
|
||||
Reference in New Issue
Block a user