切换导航条
此项目
正在载入...
登录
anyv
/
xkeasy
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
anyv
6 years ago
提交
16f005fdafd0f44f1f6ad3d065a337eccdfeda90
1 个父辈
7c106f68
1 个管道 的构建
通过
耗费 3 秒
4
变更
5
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
35 行增加
和
35 行删除
app/admin/controller/SalesmanController.php
app/portal/controller/SalesmangoodsController.php
public/themes/admin_simpleboot3/admin/salesman/salesman_goods_add.html
public/themes/admin_simpleboot3/admin/salesman/salesman_goods_edit.html
public/themes/simpleboot3/portal/salesmangoods/salesman_goods_add.html
app/admin/controller/SalesmanController.php
查看文件 @
16f005f
...
...
@@ -136,6 +136,9 @@ class SalesmanController extends AdminBaseController{
public
function
salesman_goods_add
(){
if
(
$this
->
request
->
isPost
()){
if
(
$_POST
[
'money'
]
>
$_POST
[
'price'
]){
$this
->
error
(
'佣金不能大于售价'
);
}
$goods_data
=
Db
::
name
(
'goods'
)
->
where
(
'uid'
,
$_POST
[
'uid'
])
->
select
()
->
toArray
();
if
(
count
(
$goods_data
)
>=
8
){
$this
->
error
(
'添加失败'
);
...
...
@@ -182,6 +185,9 @@ class SalesmanController extends AdminBaseController{
public
function
salesman_goods_edit
(){
if
(
$this
->
request
->
isPost
()){
if
(
$_POST
[
'money'
]
>
$_POST
[
'price'
]){
$this
->
error
(
'佣金不能大于售价'
);
}
if
(
!
empty
(
$_POST
[
'det_img'
])){
$_POST
[
'det_img'
]
=
json_encode
(
$_POST
[
'det_img'
]);
$_POST
[
'det_name'
]
=
json_encode
(
$_POST
[
'det_name'
]);
...
...
app/portal/controller/SalesmangoodsController.php
查看文件 @
16f005f
...
...
@@ -101,6 +101,14 @@ class SalesmangoodsController extends WeChatBaseController{
public
function
Salesman_goods_add
(){
if
(
$this
->
request
->
isPost
()){
$uid
=
cmf_get_current_user_id
();
$salesman_goods
=
Db
::
name
(
'goods'
)
->
where
(
"uid="
.
$uid
.
" and type = 2"
)
->
select
();
if
(
count
(
$salesman_goods
)
>=
8
){
return
3
;
}
if
(
$_POST
[
'money'
]
>
$_POST
[
'price'
]){
return
2
;
}
$data
[
'show_img'
]
=
$_POST
[
'show_img'
];
$data
[
'thumbnail'
]
=
$_POST
[
'thumbnail'
];
$data
[
'book_name'
]
=
$_POST
[
'book_name'
];
...
...
public/themes/admin_simpleboot3/admin/salesman/salesman_goods_add.html
查看文件 @
16f005f
...
...
@@ -33,7 +33,7 @@
<li><a
href=
"{:url('Salesman/salesman_goods_list',array('uid'=>$good_uid))}"
>
商品管理列表
</a></li>
<li
class=
"active"
><a
href=
"#"
>
添加商品
</a></li>
</ul>
<form
action=
"{:url('Salesman/salesman_goods_add')}"
method=
"post"
class=
"form-horizontal js-ajax-form margin-top-20"
>
<form
id=
"AddProductPicture"
action=
"{:url('Salesman/salesman_goods_add')}"
method=
"post"
class=
"form-horizontal js-ajax-form margin-top-20"
>
<div
class=
"row"
>
<div
class=
"col-md-9"
>
<table
class=
"table table-bordered"
>
...
...
@@ -56,11 +56,7 @@
<td><input
class=
"form-control"
type=
"text"
name=
"price"
id=
"source"
value=
""
placeholder=
"请输入售价"
></td>
</tr>
<tr>
<th>
定价
</th>
<td><input
class=
"form-control"
type=
"text"
name=
"pricing"
value=
""
placeholder=
"请输入定价"
></td>
</tr>
<tr>
<th>
商品说明
</th>
<td>
...
...
@@ -144,6 +140,11 @@
class=
"btn btn-default btn-sm"
>
选择图片
</a>
</td>
</tr>
<tr>
<th>
定价
</th>
<td><input
class=
"form-control"
type=
"text"
name=
"pricing"
value=
""
placeholder=
"请输入定价"
></td>
</tr>
</table>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
...
...
@@ -185,6 +186,7 @@
</div>
</td>
</tr>
</table>
</div>
</div>
...
...
@@ -197,29 +199,7 @@
</script>
<script
type=
"text/javascript"
src=
"__STATIC__/js/ueditor/ueditor.config.js"
></script>
<script
type=
"text/javascript"
src=
"__STATIC__/js/ueditor/ueditor.all.min.js"
></script>
<script
type=
"text/javascript"
>
$
(
function
()
{
editorcontent
=
new
baidu
.
editor
.
ui
.
Editor
();
editorcontent
.
render
(
'content'
);
try
{
editorcontent
.
sync
();
}
catch
(
err
)
{
}
$
(
'.btn-cancel-thumbnail'
).
click
(
function
()
{
$
(
'#thumbnail-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#thumbnail'
).
val
(
''
);
});
});
$
(
function
()
{
$
(
'.btn-cancel-thumbnails'
).
click
(
function
()
{
$
(
'#thumbnails-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#thumbnails'
).
val
(
''
);
});
});
<script>
</script>
</body>
...
...
public/themes/admin_simpleboot3/admin/salesman/salesman_goods_edit.html
查看文件 @
16f005f
...
...
@@ -55,11 +55,7 @@
<td><input
class=
"form-control"
type=
"text"
name=
"price"
id=
"source"
value=
"{$data.price}"
placeholder=
"请输入售价"
></td>
</tr>
<tr>
<th>
定价
</th>
<td><input
class=
"form-control"
type=
"text"
name=
"pricing"
value=
"{$data.pricing}"
placeholder=
"请输入定价"
></td>
</tr>
<tr>
<th>
商品说明
</th>
<td>
...
...
@@ -162,6 +158,11 @@
class=
"btn btn-default btn-sm"
>
选择图片
</a>
</td>
</tr>
<tr>
<th>
定价
</th>
<td><input
class=
"form-control"
type=
"text"
name=
"pricing"
value=
"{$data.pricing}"
placeholder=
"请输入定价"
></td>
</tr>
</table>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
...
...
@@ -215,6 +216,7 @@
</div>
</td>
</tr>
</table>
</div>
</div>
...
...
public/themes/simpleboot3/portal/salesmangoods/salesman_goods_add.html
查看文件 @
16f005f
...
...
@@ -503,7 +503,11 @@
}
$
.
post
(
"{:url('Salesmangoods/Salesman_goods_add')}"
,{
show_img
:
show_img
,
thumbnail
:
thumbnail
,
book_name
:
book_name
,
money
:
money
,
price
:
price
,
pricing
:
pricing
,
instr
:
instr
,
book_number
:
book_number
,
paper
:
paper
,
book_size
:
book_size
,
binding
:
binding
,
author
:
author
,
press
:
press
,
press_time
:
press_time
,
suit
:
suit
,
grade
:
grade
,
img0
:
img0
,
img1
:
img1
,
img2
:
img2
,
printing
:
printing
},
function
(
data
){
if
(
data
){
if
(
data
==
3
){
alert
(
'添加失败,业务员书籍不能超过8本'
);
}
else
if
(
data
==
2
){
alert
(
'佣金不能大于售价'
);
}
else
if
(
data
){
window
.
location
.
href
=
"{:url('salesmangoods/salesman_goods')}"
;
}
else
{
alert
(
'添加失败'
);
...
...
请
注册
或
登录
后发表评论