切换导航条
此项目
正在载入...
登录
王晓刚
/
market
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
耿培杰
5 years ago
提交
7abe218381d1db15d75537278548349d77047fba
1 个父辈
50d2f811
修改商品分类多选
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
14 行增加
和
14 行删除
application/admin/controller/Goods.php
application/admin/view/goods/add.html
application/admin/view/goods/edit.html
application/admin/controller/Goods.php
查看文件 @
7abe218
...
...
@@ -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人'
);
...
...
application/admin/view/goods/add.html
查看文件 @
7abe218
...
...
@@ -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"
>
...
...
application/admin/view/goods/edit.html
查看文件 @
7abe218
...
...
@@ -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"
>
...
...
请
注册
或
登录
后发表评论