1.提交缺失的东西
This commit is contained in:
@ -55,14 +55,14 @@ class GoodsController extends BaseAdminController
|
|||||||
$post['del'] = 0;
|
$post['del'] = 0;
|
||||||
|
|
||||||
//主表验证
|
//主表验证
|
||||||
$result = $this->validate($post, 'app\admin\validate\GoodsValidate.add');
|
$result = $this->validate($post, 'app\adminapi\validate\GoodsValidate.add');
|
||||||
if ($result !== true) {
|
if ($result !== true) {
|
||||||
return $this->fail($result);
|
return $this->fail($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
//单规格验证
|
//单规格验证
|
||||||
if ($post['spec_type'] == 1) {
|
if ($post['spec_type'] == 1) {
|
||||||
$result = $this->validate($post, 'app\admin\validate\GoodsOneSpecValidate');
|
$result = $this->validate($post, 'app\adminapi\validate\GoodsOneSpecValidate');
|
||||||
if ($result !== true) {
|
if ($result !== true) {
|
||||||
return $this->fail($result);
|
return $this->fail($result);
|
||||||
}
|
}
|
||||||
@ -94,14 +94,14 @@ class GoodsController extends BaseAdminController
|
|||||||
if (empty($spec_lists)) {
|
if (empty($spec_lists)) {
|
||||||
return $this->fail('至少添加一个规格');
|
return $this->fail('至少添加一个规格');
|
||||||
}
|
}
|
||||||
$result = $this->validate($post, 'app\admin\validate\GoodsMoreSpecValidate');
|
$result = $this->validate($post, 'app\adminapi\validate\GoodsMoreSpecValidate');
|
||||||
if ($result !== true) {
|
if ($result !== true) {
|
||||||
return $this->fail($result);
|
return $this->fail($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
//规格商品列表验证
|
//规格商品列表验证
|
||||||
foreach ($spec_lists as $v) {
|
foreach ($spec_lists as $v) {
|
||||||
$result = $this->validate($v, 'app\admin\validate\GoodsMoreSpecListsValidate');
|
$result = $this->validate($v, 'app\adminapi\validate\GoodsMoreSpecListsValidate');
|
||||||
if ($result !== true) {
|
if ($result !== true) {
|
||||||
return $this->fail($result);
|
return $this->fail($result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user