作者 耿培杰

修改商品分类多选

... ... @@ -108,13 +108,13 @@ class Goods extends Backend
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
$this->model->validateFailException(true)->validate($validate);
}
if (empty($params['category_group_ids'])) $this->error('一级分类不能为空');
if (empty($params['category_one_id'])) $this->error('二级分类不能为空');
if (empty($params['category_two_id'])) $this->error('三级分类不能为空');
$params['category_group_ids'] = ',' . $params['category_group_ids'] . ',';
if (empty($params['category_one_id'])) $this->error('一级分类不能为空');
if (empty($params['category_two_id'])) $this->error('二级分类不能为空');
if (empty($params['category_three_id'])) $this->error('三级分类不能为空');
$params['category_one_id'] = ',' . $params['category_one_id'] . ',';
$params['category_two_id'] = ',' . $params['category_two_id'] . ',';
if (!empty($params['category_three_id'])) $params['category_three_id'] = ',' . $params['category_three_id'] . ',';
$params['category_three_id'] = ',' . $params['category_three_id'] . ',';
if (!empty($params['category_group_ids'])) $params['category_group_ids'] = ',' . $params['category_group_ids'] . ',';
if ($params['is_group'] == 1) {
if (empty($params['group_num'])) $this->error('团购人数不能为空');
if (!empty($params['group_num']) && $params['group_num'] == 1) $this->error('团购人数必须大于1人');
... ... @@ -179,13 +179,13 @@ class Goods extends Backend
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
$row->validateFailException(true)->validate($validate);
}
if (empty($params['category_group_ids'])) $this->error('一级分类不能为空');
if (empty($params['category_one_id'])) $this->error('二级分类不能为空');
if (empty($params['category_two_id'])) $this->error('三级分类不能为空');
$params['category_group_ids'] = ',' . $params['category_group_ids'] . ',';
if (empty($params['category_one_id'])) $this->error('一级分类不能为空');
if (empty($params['category_two_id'])) $this->error('二级分类不能为空');
if (empty($params['category_three_id'])) $this->error('三级分类不能为空');
$params['category_one_id'] = ',' . $params['category_one_id'] . ',';
$params['category_two_id'] = ',' . $params['category_two_id'] . ',';
if (!empty($params['category_three_id'])) $params['category_three_id'] = ',' . $params['category_three_id'] . ',';
$params['category_three_id'] = ',' . $params['category_three_id'] . ',';
if (!empty($params['category_group_ids'])) $params['category_group_ids'] = ',' . $params['category_group_ids'] . ',';
if ($params['is_group'] == 1) {
if (empty($params['group_num'])) $this->error('团购人数不能为空');
if (!empty($params['group_num']) && $params['group_num'] == 1) $this->error('团购人数必须大于1人');
... ...
... ... @@ -9,13 +9,13 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Category_two_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-category_two_id" data-source="category/selectpage" data-params='{"custom[pid]":$_GET["pid"]}' data-multiple="true" class="form-control selectpage" name="row[category_two_id]" type="text" value="">
<input id="c-category_two_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_two_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Category_three_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-category_three_id" data-source="category/selectpage" data-params='{"custom[pid]":"-1"}' data-multiple="true" class="form-control selectpage" name="row[category_three_id]" type="text" value="">
<input id="c-category_three_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_three_id]" type="text" value="">
</div>
</div>
<div class="form-group">
... ...
... ... @@ -9,13 +9,13 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Category_two_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-category_two_id" data-source="category/selectpage" data-multiple="true" data-params='{"custom[pid]":{$row.category_one_id}}' class="form-control selectpage" name="row[category_two_id]" type="text" value="{$row.category_two_id|htmlentities}">
<input id="c-category_two_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_two_id]" type="text" value="{$row.category_two_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Category_three_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-category_three_id" data-source="category/selectpage" data-multiple="true" data-params='{"custom[pid]":{$row.category_two_id}}' class="form-control selectpage" name="row[category_three_id]" type="text" value="{$row.category_three_id|htmlentities}">
<input id="c-category_three_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_three_id]" type="text" value="{$row.category_three_id|htmlentities}">
</div>
</div>
<div class="form-group">
... ...