Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
76c0a7b1
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
76c0a7b1
编写于
11月 13, 2018
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
库存回滚
上级
c549dafe
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
203 addition
and
63 deletion
+203
-63
service/Application/Admin/Controller/AdminController.class.php
...ce/Application/Admin/Controller/AdminController.class.php
+9
-3
service/Application/Admin/Controller/PowerController.class.php
...ce/Application/Admin/Controller/PowerController.class.php
+36
-13
service/Application/Admin/View/Default/Admin/Index.html
service/Application/Admin/View/Default/Admin/Index.html
+2
-0
service/Application/Admin/View/Default/Article/Index.html
service/Application/Admin/View/Default/Article/Index.html
+1
-1
service/Application/Admin/View/Default/Config/Index.html
service/Application/Admin/View/Default/Config/Index.html
+2
-2
service/Application/Admin/View/Default/Power/Role.html
service/Application/Admin/View/Default/Power/Role.html
+1
-1
service/Application/Admin/View/Default/Sms/Index.html
service/Application/Admin/View/Default/Sms/Index.html
+3
-3
service/Application/Home/Controller/UserController.class.php
service/Application/Home/Controller/UserController.class.php
+3
-0
service/Application/Home/View/Default/User/Index.html
service/Application/Home/View/Default/User/Index.html
+8
-0
service/Application/Service/BuyService.class.php
service/Application/Service/BuyService.class.php
+83
-5
service/Application/Service/OrderService.class.php
service/Application/Service/OrderService.class.php
+20
-3
service/Public/Home/Default/Css/User.Index.css
service/Public/Home/Default/Css/User.Index.css
+1
-0
shopxo.sql
shopxo.sql
+34
-32
未找到文件。
service/Application/Admin/Controller/AdminController.class.php
浏览文件 @
76c0a7b1
...
@@ -60,6 +60,13 @@ class AdminController extends CommonController
...
@@ -60,6 +60,13 @@ class AdminController extends CommonController
// 获取管理员列表
// 获取管理员列表
$list
=
$m
->
where
(
$where
)
->
limit
(
$page
->
GetPageStarNumber
(),
$number
)
->
select
();
$list
=
$m
->
where
(
$where
)
->
limit
(
$page
->
GetPageStarNumber
(),
$number
)
->
select
();
if
(
!
empty
(
$list
))
{
foreach
(
$list
as
&
$v
)
{
$v
[
'role_name'
]
=
M
(
'Role'
)
->
where
([
'id'
=>
$v
[
'role_id'
]])
->
getField
(
'name'
);
}
}
// 角色
// 角色
$role
=
M
(
'Role'
)
->
field
(
array
(
'id'
,
'name'
))
->
where
(
array
(
'is_enable'
=>
1
))
->
select
();
$role
=
M
(
'Role'
)
->
field
(
array
(
'id'
,
'name'
))
->
where
(
array
(
'is_enable'
=>
1
))
->
select
();
...
@@ -88,8 +95,7 @@ class AdminController extends CommonController
...
@@ -88,8 +95,7 @@ class AdminController extends CommonController
{
{
$where
[
'username'
]
=
array
(
'like'
,
'%'
.
I
(
'username'
)
.
'%'
);
$where
[
'username'
]
=
array
(
'like'
,
'%'
.
I
(
'username'
)
.
'%'
);
}
}
if
(
!
empty
(
$_REQUEST
[
'role_id'
])
&&
I
(
'role_id'
)
!=
-
1
)
if
(
I
(
'role_id'
,
-
1
)
>
-
1
)
if
(
$role_id
>
0
)
{
{
$where
[
'role_id'
]
=
I
(
'role_id'
);
$where
[
'role_id'
]
=
I
(
'role_id'
);
}
}
...
@@ -134,7 +140,7 @@ class AdminController extends CommonController
...
@@ -134,7 +140,7 @@ class AdminController extends CommonController
$this
->
assign
(
'data'
,
$user
);
$this
->
assign
(
'data'
,
$user
);
}
}
$role
=
M
(
'Role'
)
->
field
(
array
(
'id'
,
'name'
))
->
where
(
array
(
'is_enable'
=>
1
,
'id'
=>
array
(
'gt'
,
1
)
))
->
select
();
$role
=
M
(
'Role'
)
->
field
(
array
(
'id'
,
'name'
))
->
where
(
array
(
'is_enable'
=>
1
))
->
select
();
$this
->
assign
(
'role'
,
$role
);
$this
->
assign
(
'role'
,
$role
);
// 组织列表
// 组织列表
...
...
service/Application/Admin/Controller/PowerController.class.php
浏览文件 @
76c0a7b1
...
@@ -296,12 +296,12 @@ class PowerController extends CommonController
...
@@ -296,12 +296,12 @@ class PowerController extends CommonController
$role_id
=
$r
->
add
(
$role_data
);
$role_id
=
$r
->
add
(
$role_data
);
// 角色权限关联添加
// 角色权限关联添加
$rp_stat
e
=
true
;
$rp_stat
us
=
true
;
if
(
!
empty
(
$_POST
[
'power_id'
])
&&
is_array
(
$_POST
[
'power_id'
])
)
if
(
!
empty
(
$_POST
[
'power_id'
]))
{
{
// 角色权限关联对象
// 角色权限关联对象
$rp
=
M
(
'RolePower'
);
$rp
=
M
(
'RolePower'
);
foreach
(
$_POST
[
'power_id'
]
as
$power_id
)
foreach
(
explode
(
','
,
I
(
'power_id'
))
as
$power_id
)
{
{
if
(
!
empty
(
$power_id
))
if
(
!
empty
(
$power_id
))
{
{
...
@@ -312,13 +312,13 @@ class PowerController extends CommonController
...
@@ -312,13 +312,13 @@ class PowerController extends CommonController
);
);
if
(
!
$rp
->
add
(
$rp_data
))
if
(
!
$rp
->
add
(
$rp_data
))
{
{
$rp_stat
e
=
false
;
$rp_stat
us
=
false
;
break
;
break
;
}
}
}
}
}
}
}
}
if
(
$role_id
&&
$rp_stat
e
)
if
(
$role_id
&&
$rp_stat
us
)
{
{
// 提交事务
// 提交事务
$r
->
commit
();
$r
->
commit
();
...
@@ -372,11 +372,10 @@ class PowerController extends CommonController
...
@@ -372,11 +372,10 @@ class PowerController extends CommonController
$rp_del_state
=
$rp
->
where
(
array
(
'role_id'
=>
$role_id
))
->
delete
();
$rp_del_state
=
$rp
->
where
(
array
(
'role_id'
=>
$role_id
))
->
delete
();
// 权限关联数据添加
// 权限关联数据添加
$rp_stat
e
=
true
;
$rp_stat
us
=
true
;
if
(
!
empty
(
$_POST
[
'power_id'
]))
if
(
!
empty
(
$_POST
[
'power_id'
]))
{
{
$power_id_list
=
explode
(
','
,
$_POST
[
'power_id'
]);
foreach
(
explode
(
','
,
I
(
'power_id'
))
as
$power_id
)
foreach
(
$power_id_list
as
$power_id
)
{
{
if
(
!
empty
(
$power_id
))
if
(
!
empty
(
$power_id
))
{
{
...
@@ -387,13 +386,13 @@ class PowerController extends CommonController
...
@@ -387,13 +386,13 @@ class PowerController extends CommonController
);
);
if
(
!
$rp
->
add
(
$rp_data
))
if
(
!
$rp
->
add
(
$rp_data
))
{
{
$rp_stat
e
=
false
;
$rp_stat
us
=
false
;
break
;
break
;
}
}
}
}
}
}
}
}
if
(
$r_state
!==
false
&&
$rp_del_state
!==
false
&&
$rp_stat
e
!==
false
)
if
(
$r_state
!==
false
&&
$rp_del_state
!==
false
&&
$rp_stat
us
!==
false
)
{
{
// 提交事务
// 提交事务
$r
->
commit
();
$r
->
commit
();
...
@@ -440,9 +439,9 @@ class PowerController extends CommonController
...
@@ -440,9 +439,9 @@ class PowerController extends CommonController
$r
->
startTrans
();
$r
->
startTrans
();
// 删除角色
// 删除角色
$role_stat
e
=
$r
->
delete
(
I
(
'id'
));
$role_stat
us
=
$r
->
delete
(
I
(
'id'
));
$rp_stat
e
=
M
(
'RolePower'
)
->
where
(
array
(
'role_id'
=>
I
(
'id'
)))
->
delete
();
$rp_stat
us
=
M
(
'RolePower'
)
->
where
(
array
(
'role_id'
=>
I
(
'id'
)))
->
delete
();
if
(
$role_stat
e
!==
false
&&
$rp_state
!==
false
)
if
(
$role_stat
us
!==
false
&&
$rp_status
!==
false
)
{
{
// 提交事务
// 提交事务
$r
->
commit
();
$r
->
commit
();
...
@@ -457,5 +456,29 @@ class PowerController extends CommonController
...
@@ -457,5 +456,29 @@ class PowerController extends CommonController
$this
->
ajaxReturn
(
L
(
'common_operation_delete_error'
),
-
100
);
$this
->
ajaxReturn
(
L
(
'common_operation_delete_error'
),
-
100
);
}
}
}
}
/**
* [RoleStatusUpdate 角色状态更新]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-01-12T22:23:06+0800
*/
public
function
RoleStatusUpdate
()
{
// 参数
if
(
empty
(
$_POST
[
'id'
])
||
!
isset
(
$_POST
[
'state'
]))
{
$this
->
ajaxReturn
(
L
(
'common_param_error'
),
-
1
);
}
// 数据更新
if
(
M
(
'Role'
)
->
where
(
array
(
'id'
=>
I
(
'id'
)))
->
save
(
array
(
'is_enable'
=>
I
(
'state'
))))
{
$this
->
ajaxReturn
(
L
(
'common_operation_edit_success'
));
}
else
{
$this
->
ajaxReturn
(
L
(
'common_operation_edit_error'
),
-
100
);
}
}
}
}
?>
?>
\ No newline at end of file
service/Application/Admin/View/Default/Admin/Index.html
浏览文件 @
76c0a7b1
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
<th>
{{:L('common_view_gender_name')}}
</th>
<th>
{{:L('common_view_gender_name')}}
</th>
<th>
{{:L('login_total_name')}}
</th>
<th>
{{:L('login_total_name')}}
</th>
<th>
{{:L('common_mobile_name')}}
</th>
<th>
{{:L('common_mobile_name')}}
</th>
<th
class=
"am-hide-sm-only"
>
{{:L('admin_view_role_name')}}
</th>
<th
class=
"am-hide-sm-only"
>
{{:L('login_last_time_name')}}
</th>
<th
class=
"am-hide-sm-only"
>
{{:L('login_last_time_name')}}
</th>
<th
class=
"am-hide-sm-only"
>
{{:L('common_create_time_name')}}
</th>
<th
class=
"am-hide-sm-only"
>
{{:L('common_create_time_name')}}
</th>
<th>
{{:L('common_operation_name')}}
</th>
<th>
{{:L('common_operation_name')}}
</th>
...
@@ -60,6 +61,7 @@
...
@@ -60,6 +61,7 @@
<td>
{{:L('common_gender_list')[$v['gender']]['name']}}
</td>
<td>
{{:L('common_gender_list')[$v['gender']]['name']}}
</td>
<td>
{{$v.login_total}}
</td>
<td>
{{$v.login_total}}
</td>
<td><if
condition=
"empty($v['mobile'])"
><span
class=
"cr-ddd"
>
{{:L('common_on_fill_in_the_text')}}
</span><else
/>
{{$v.mobile}}
</if></td>
<td><if
condition=
"empty($v['mobile'])"
><span
class=
"cr-ddd"
>
{{:L('common_on_fill_in_the_text')}}
</span><else
/>
{{$v.mobile}}
</if></td>
<td
class=
"am-hide-sm-only"
>
{{$v.role_name}}
</td>
<td
class=
"am-hide-sm-only"
>
<td
class=
"am-hide-sm-only"
>
<if
condition=
"$v['login_total'] eq 0"
>
<if
condition=
"$v['login_total'] eq 0"
>
{{:L('common_not_login_name')}}
{{:L('common_not_login_name')}}
...
...
service/Application/Admin/View/Default/Article/Index.html
浏览文件 @
76c0a7b1
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
<td
class=
"am-hide-sm-only"
>
{{$v.article_category_name}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.article_category_name}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.access_count}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.access_count}}
</td>
<td>
<td>
<a
href=
"
{{:HomeUrl('Article', 'Index', ['id'=>$v['id']])}}
"
class=
"am-icon-btn am-icon-check submit-state <if condition="
$
v
['
is_enable
']
eq
1"
>
am-success
<else
/>
am-default
</if>
" data-url="{{:U('Admin/Article/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1">
</a>
<a
href=
"
javascript:;
"
class=
"am-icon-btn am-icon-check submit-state <if condition="
$
v
['
is_enable
']
eq
1"
>
am-success
<else
/>
am-default
</if>
" data-url="{{:U('Admin/Article/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1">
</a>
</td>
</td>
<td>
<td>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state <if condition="
$
v
['
is_home_recommended
']
eq
1"
>
am-success
<else
/>
am-default
</if>
" data-url="{{:U('Admin/Article/StatusHomeRecommended')}}" data-id="{{$v.id}}" data-state="{{$v['is_home_recommended']}}">
</a>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state <if condition="
$
v
['
is_home_recommended
']
eq
1"
>
am-success
<else
/>
am-default
</if>
" data-url="{{:U('Admin/Article/StatusHomeRecommended')}}" data-id="{{$v.id}}" data-state="{{$v['is_home_recommended']}}">
</a>
...
...
service/Application/Admin/View/Default/Config/Index.html
浏览文件 @
76c0a7b1
...
@@ -45,14 +45,14 @@
...
@@ -45,14 +45,14 @@
<label>
{{$data.common_share_giving_integral_frequency.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_share_giving_integral_frequency.describe}})
</span></label>
<label>
{{$data.common_share_giving_integral_frequency.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_share_giving_integral_frequency.describe}})
</span></label>
<input
type=
"number"
name=
"{{$data.common_share_giving_integral_frequency.only_tag}}"
placeholder=
"{{$data.common_share_giving_integral_frequency.name}}"
data-validation-message=
"{{$data.common_share_giving_integral_frequency.error_tips}}"
class=
"am-radius"
<
present
name=
"data"
>
value="{{$data.common_share_giving_integral_frequency.value}}"
</present>
/>
<input
type=
"number"
name=
"{{$data.common_share_giving_integral_frequency.only_tag}}"
placeholder=
"{{$data.common_share_giving_integral_frequency.name}}"
data-validation-message=
"{{$data.common_share_giving_integral_frequency.error_tips}}"
class=
"am-radius"
<
present
name=
"data"
>
value="{{$data.common_share_giving_integral_frequency.value}}"
</present>
/>
</div>
</div>
<div
class=
"am-form-group"
>
<
!-- <
div class="am-form-group">
<label>{{$data.common_share_giving_integral.name}}<span class="fs-12 fw-100 cr-999">({{$data.common_share_giving_integral.describe}})</span></label>
<label>{{$data.common_share_giving_integral.name}}<span class="fs-12 fw-100 cr-999">({{$data.common_share_giving_integral.describe}})</span></label>
<input type="number" name="{{$data.common_share_giving_integral.only_tag}}" placeholder="{{$data.common_share_giving_integral.name}}" data-validation-message="{{$data.common_share_giving_integral.error_tips}}" class="am-radius" <present name="data"> value="{{$data.common_share_giving_integral.value}}"</present> />
<input type="number" name="{{$data.common_share_giving_integral.only_tag}}" placeholder="{{$data.common_share_giving_integral.name}}" data-validation-message="{{$data.common_share_giving_integral.error_tips}}" class="am-radius" <present name="data"> value="{{$data.common_share_giving_integral.value}}"</present> />
</div>
</div>
<div class="am-form-group">
<div class="am-form-group">
<label>{{$data.common_share_view_desc.name}}</label>
<label>{{$data.common_share_view_desc.name}}</label>
<textarea rows="3" name="{{$data.common_share_view_desc.only_tag}}" class="am-radius" placeholder="{{$data.common_share_view_desc.name}}" data-validation-message="{{$data.common_share_view_desc.error_tips}}"><present name="data">{{$data.common_share_view_desc.value}}</present></textarea>
<textarea rows="3" name="{{$data.common_share_view_desc.only_tag}}" class="am-radius" placeholder="{{$data.common_share_view_desc.name}}" data-validation-message="{{$data.common_share_view_desc.error_tips}}"><present name="data">{{$data.common_share_view_desc.value}}</present></textarea>
</div>
</div>
-->
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
<label>
{{$data.common_user_center_notice.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_user_center_notice.describe}})
</span></label>
<label>
{{$data.common_user_center_notice.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_user_center_notice.describe}})
</span></label>
<textarea
rows=
"3"
name=
"{{$data.common_user_center_notice.only_tag}}"
class=
"am-radius"
placeholder=
"{{$data.common_user_center_notice.name}}"
data-validation-message=
"{{$data.common_user_center_notice.error_tips}}"
><present
name=
"data"
>
{{$data.common_user_center_notice.value}}
</present></textarea>
<textarea
rows=
"3"
name=
"{{$data.common_user_center_notice.only_tag}}"
class=
"am-radius"
placeholder=
"{{$data.common_user_center_notice.name}}"
data-validation-message=
"{{$data.common_user_center_notice.error_tips}}"
><present
name=
"data"
>
{{$data.common_user_center_notice.value}}
</present></textarea>
...
...
service/Application/Admin/View/Default/Power/Role.html
浏览文件 @
76c0a7b1
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<tr
id=
"data-list-{{$v.id}}"
<
if
condition=
"$v['is_enable'] eq 0"
>
class="am-active"
</if>
>
<tr
id=
"data-list-{{$v.id}}"
<
if
condition=
"$v['is_enable'] eq 0"
>
class="am-active"
</if>
>
<td>
{{$v.name}}
</td>
<td>
{{$v.name}}
</td>
<td>
<td>
<
span
<
if
condition=
"$v['is_enable'] eq 0"
>
class="cr-ccc"
</if>
>{{:L('common_is_enable_tips')[$v['is_enable']]['name']}}
</span
>
<
a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state <if condition="
$
v
['
is_enable
']
eq
1"
>
am-success
<else
/>
am-default
</if>
" data-url="{{:U('Admin/Power/RoleStatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1">
</a
>
</td>
</td>
<td
class=
"am-hide-sm-only"
>
{{:date('Y-m-d H:i:s', $v['add_time'])}}
</td>
<td
class=
"am-hide-sm-only"
>
{{:date('Y-m-d H:i:s', $v['add_time'])}}
</td>
<td>
<td>
...
...
service/Application/Admin/View/Default/Sms/Index.html
浏览文件 @
76c0a7b1
...
@@ -11,15 +11,15 @@
...
@@ -11,15 +11,15 @@
<form
class=
"am-form form-validation view-save"
action=
"{{:U('Admin/Sms/Save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:U('Admin/Sms/Index', ['type'=>'sms'])}}"
>
<form
class=
"am-form form-validation view-save"
action=
"{{:U('Admin/Sms/Save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:U('Admin/Sms/Index', ['type'=>'sms'])}}"
>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
<label>
{{$data.common_sms_apikey.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_sms_apikey.describe}})
</span></label>
<label>
{{$data.common_sms_apikey.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_sms_apikey.describe}})
</span></label>
<input
type=
"text"
name=
"{{$data.common_sms_apikey.only_tag}}"
placeholder=
"{{$data.common_sms_apikey.name}}"
data-validation-message=
"{{$data.common_sms_apikey.error_tips}}"
class=
"am-radius"
<
present
name=
"data"
>
value="{{$data.common_sms_apikey.value}}"
</present>
required
/>
<input
type=
"text"
name=
"{{$data.common_sms_apikey.only_tag}}"
placeholder=
"{{$data.common_sms_apikey.name}}"
data-validation-message=
"{{$data.common_sms_apikey.error_tips}}"
class=
"am-radius"
<
present
name=
"data"
>
value="{{$data.common_sms_apikey.value}}"
</present>
/>
</div>
</div>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
<label>
{{$data.common_sms_apisecret.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_sms_apisecret.describe}})
</span></label>
<label>
{{$data.common_sms_apisecret.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_sms_apisecret.describe}})
</span></label>
<input
type=
"text"
name=
"{{$data.common_sms_apisecret.only_tag}}"
placeholder=
"{{$data.common_sms_apisecret.name}}"
data-validation-message=
"{{$data.common_sms_apisecret.error_tips}}"
class=
"am-radius"
<
present
name=
"data"
>
value="{{$data.common_sms_apisecret.value}}"
</present>
required
/>
<input
type=
"text"
name=
"{{$data.common_sms_apisecret.only_tag}}"
placeholder=
"{{$data.common_sms_apisecret.name}}"
data-validation-message=
"{{$data.common_sms_apisecret.error_tips}}"
class=
"am-radius"
<
present
name=
"data"
>
value="{{$data.common_sms_apisecret.value}}"
</present>
/>
</div>
</div>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
<label>
{{$data.common_sms_sign.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_sms_sign.describe}})
</span></label>
<label>
{{$data.common_sms_sign.name}}
<span
class=
"fs-12 fw-100 cr-999"
>
({{$data.common_sms_sign.describe}})
</span></label>
<input
type=
"text"
name=
"{{$data.common_sms_sign.only_tag}}"
placeholder=
"{{$data.common_sms_sign.name}}"
data-validation-message=
"{{$data.common_sms_sign.error_tips}}"
class=
"am-radius"
minlength=
"3"
maxlength=
"16"
<
present
name=
"data"
>
value="{{$data.common_sms_sign.value}}"
</present>
required
/>
<input
type=
"text"
name=
"{{$data.common_sms_sign.only_tag}}"
placeholder=
"{{$data.common_sms_sign.name}}"
data-validation-message=
"{{$data.common_sms_sign.error_tips}}"
class=
"am-radius"
minlength=
"3"
maxlength=
"16"
<
present
name=
"data"
>
value="{{$data.common_sms_sign.value}}"
</present>
/>
</div>
</div>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'{{:L('common_form_loading_tips')}}'}"
>
{{:L('common_operation_save')}}
</button>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'{{:L('common_form_loading_tips')}}'}"
>
{{:L('common_operation_save')}}
</button>
...
...
service/Application/Home/Controller/UserController.class.php
浏览文件 @
76c0a7b1
...
@@ -121,6 +121,9 @@ class UserController extends CommonController
...
@@ -121,6 +121,9 @@ class UserController extends CommonController
$data
=
GoodsService
::
GoodsBrowseList
(
$browse_params
);
$data
=
GoodsService
::
GoodsBrowseList
(
$browse_params
);
$this
->
assign
(
'goods_browse_list'
,
$data
[
'data'
]);
$this
->
assign
(
'goods_browse_list'
,
$data
[
'data'
]);
// 用户中心公告
$this
->
assign
(
'common_user_center_notice'
,
MyC
(
'common_user_center_notice'
));
$this
->
display
(
'Index'
);
$this
->
display
(
'Index'
);
}
}
...
...
service/Application/Home/View/Default/User/Index.html
浏览文件 @
76c0a7b1
...
@@ -26,6 +26,14 @@
...
@@ -26,6 +26,14 @@
<!-- content start -->
<!-- content start -->
<div
class=
"user-content"
>
<div
class=
"user-content"
>
<div
class=
"user-content-body"
>
<div
class=
"user-content-body"
>
<!-- 公告 -->
<notempty
name=
"common_user_center_notice"
>
<div
class=
"am-alert am-alert-warning am-radius user-center-notice"
data-am-alert
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
{{$common_user_center_notice}}
</p>
</div>
</notempty>
<!-- 基础信息 -->
<!-- 基础信息 -->
<div
class=
"user-base"
>
<div
class=
"user-base"
>
<div
class=
"user-base-left"
>
<div
class=
"user-base-left"
>
...
...
service/Application/Service/BuyService.class.php
浏览文件 @
76c0a7b1
...
@@ -786,7 +786,7 @@ class BuyService
...
@@ -786,7 +786,7 @@ class BuyService
case
0
:
case
0
:
if
(
$params
[
'order_data'
][
'status'
]
!=
1
)
if
(
$params
[
'order_data'
][
'status'
]
!=
1
)
{
{
return
DataReturn
(
'当前订单状态未操作确认不扣除库存['
.
$params
[
'order_id'
]
.
']'
,
0
);
return
DataReturn
(
'当前订单状态未操作确认
-
不扣除库存['
.
$params
[
'order_id'
]
.
']'
,
0
);
}
}
break
;
break
;
...
@@ -794,7 +794,7 @@ class BuyService
...
@@ -794,7 +794,7 @@ class BuyService
case
1
:
case
1
:
if
(
$params
[
'order_data'
][
'status'
]
!=
2
)
if
(
$params
[
'order_data'
][
'status'
]
!=
2
)
{
{
return
DataReturn
(
'当前订单状态未操作支付不扣除库存['
.
$params
[
'order_id'
]
.
']'
,
0
);
return
DataReturn
(
'当前订单状态未操作支付
-
不扣除库存['
.
$params
[
'order_id'
]
.
']'
,
0
);
}
}
break
;
break
;
...
@@ -802,7 +802,7 @@ class BuyService
...
@@ -802,7 +802,7 @@ class BuyService
case
2
:
case
2
:
if
(
$params
[
'order_data'
][
'status'
]
!=
3
)
if
(
$params
[
'order_data'
][
'status'
]
!=
3
)
{
{
return
DataReturn
(
'当前订单状态未操作发货不扣除库存['
.
$params
[
'order_id'
]
.
']'
,
0
);
return
DataReturn
(
'当前订单状态未操作发货
-
不扣除库存['
.
$params
[
'order_id'
]
.
']'
,
0
);
}
}
break
;
break
;
}
}
...
@@ -837,13 +837,91 @@ class BuyService
...
@@ -837,13 +837,91 @@ class BuyService
'new_inventory'
=>
$goods_m
->
where
([
'id'
=>
$v
[
'goods_id'
]])
->
getField
(
'inventory'
),
'new_inventory'
=>
$goods_m
->
where
([
'id'
=>
$v
[
'goods_id'
]])
->
getField
(
'inventory'
),
'add_time'
=>
time
(),
'add_time'
=>
time
(),
];
];
$log_m
->
add
(
$log_data
);
if
(
$log_m
->
add
(
$log_data
)
<=
0
)
{
return
DataReturn
(
'库存扣减日志添加失败['
.
$params
[
'order_id'
]
.
'-'
.
$v
[
'goods_id'
]
.
']'
,
-
100
);
}
}
}
}
}
}
}
return
DataReturn
(
'操作成功'
,
0
);
}
}
return
DataReturn
(
'没有需要扣除库存的数据'
,
0
);
return
DataReturn
(
'没有需要扣除库存的数据'
,
0
);
}
/**
* 库存回滚
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-09
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
OrderInventoryRollback
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'order_id'
,
'error_msg'
=>
'订单id有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'order_data'
,
'error_msg'
=>
'订单更新数据不能为空'
,
],
[
'checked_type'
=>
'is_array'
,
'key_name'
=>
'order_data'
,
'error_msg'
=>
'订单更新数据有误'
,
]
];
$ret
=
params_checked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 订单状态
if
(
!
in_array
(
$params
[
'order_data'
][
'status'
],
[
5
,
6
]))
{
return
DataReturn
(
'当前订单状态不允许回滚库存['
.
$params
[
'order_id'
]
.
'-'
.
$params
[
'order_data'
][
'status'
]
.
']'
,
0
);
}
// 获取订单商品
$order_detail
=
M
(
'OrderDetail'
)
->
field
(
'goods_id,buy_number'
)
->
where
([
'order_id'
=>
$params
[
'order_id'
]])
->
select
();
if
(
!
empty
(
$order_detail
))
{
$goods_m
=
M
(
'Goods'
);
$log_m
=
M
(
'OrderGoodsInventoryLog'
);
foreach
(
$order_detail
as
$v
)
{
// 查看是否已扣除过库存
$temp
=
$log_m
->
where
([
'order_id'
=>
$params
[
'order_id'
],
'goods_id'
=>
$v
[
'goods_id'
],
'is_rollback'
=>
0
])
->
find
();
if
(
!
empty
(
$temp
))
{
// 回滚操作
if
(
!
$goods_m
->
where
([
'id'
=>
$v
[
'goods_id'
]])
->
setInc
(
'inventory'
,
$v
[
'buy_number'
]))
{
return
DataReturn
(
'库存回滚失败['
.
$params
[
'order_id'
]
.
'-'
.
$v
[
'goods_id'
]
.
']'
,
-
10
);
}
// 回滚日志更新
$log_data
=
[
'is_rollback'
=>
1
,
'rollback_time'
=>
time
(),
];
if
(
!
$log_m
->
where
([
'id'
=>
$temp
[
'id'
]])
->
save
(
$log_data
))
{
return
DataReturn
(
'库存回滚日志更新失败['
.
$temp
[
'id'
]
.
'-'
.
$params
[
'order_id'
]
.
']'
,
-
100
);
}
}
}
return
DataReturn
(
'操作成功'
,
0
);
}
return
DataReturn
(
'没有需要回滚的数据'
,
0
);
}
}
}
}
?>
?>
\ No newline at end of file
service/Application/Service/OrderService.class.php
浏览文件 @
76c0a7b1
...
@@ -662,21 +662,38 @@ class OrderService
...
@@ -662,21 +662,38 @@ class OrderService
return
DataReturn
(
'状态不可操作['
.
$status_text
.
']'
,
-
1
);
return
DataReturn
(
'状态不可操作['
.
$status_text
.
']'
,
-
1
);
}
}
$data
=
[
// 开启事务
$m
->
startTrans
();
$upd_data
=
[
'status'
=>
5
,
'status'
=>
5
,
'upd_time'
=>
time
(),
'upd_time'
=>
time
(),
];
];
if
(
$m
->
where
(
$where
)
->
save
(
$data
))
if
(
$m
->
where
(
$where
)
->
save
(
$
upd_
data
))
{
{
// 库存扣除
$ret
=
BuyService
::
OrderInventoryRollback
([
'order_id'
=>
$params
[
'id'
],
'order_data'
=>
$upd_data
]);
if
(
$ret
[
'status'
]
!=
0
)
{
// 事务回滚
$m
->
rollback
();
return
DataReturn
(
$ret
[
'msg'
],
-
10
);
}
// 用户消息
// 用户消息
MessageService
::
MessageAdd
(
$order
[
'user_id'
],
'订单取消'
,
'订单取消成功'
,
1
,
$order
[
'id'
]);
MessageService
::
MessageAdd
(
$order
[
'user_id'
],
'订单取消'
,
'订单取消成功'
,
1
,
$order
[
'id'
]);
// 订单状态日志
// 订单状态日志
$creator
=
isset
(
$params
[
'creator'
])
?
intval
(
$params
[
'creator'
])
:
0
;
$creator
=
isset
(
$params
[
'creator'
])
?
intval
(
$params
[
'creator'
])
:
0
;
$creator_name
=
isset
(
$params
[
'creator_name'
])
?
htmlentities
(
$params
[
'creator_name'
])
:
''
;
$creator_name
=
isset
(
$params
[
'creator_name'
])
?
htmlentities
(
$params
[
'creator_name'
])
:
''
;
self
::
OrderHistoryAdd
(
$order
[
'id'
],
$data
[
'status'
],
$order
[
'status'
],
'取消'
,
$creator
,
$creator_name
);
self
::
OrderHistoryAdd
(
$order
[
'id'
],
$upd_data
[
'status'
],
$order
[
'status'
],
'取消'
,
$creator
,
$creator_name
);
// 提交事务
$m
->
commit
();
return
DataReturn
(
L
(
'common_cancel_success'
),
0
);
return
DataReturn
(
L
(
'common_cancel_success'
),
0
);
}
}
// 事务回滚
$m
->
rollback
();
return
DataReturn
(
L
(
'common_cancel_error'
),
-
1
);
return
DataReturn
(
L
(
'common_cancel_error'
),
-
1
);
}
}
...
...
service/Public/Home/Default/Css/User.Index.css
浏览文件 @
76c0a7b1
...
@@ -52,6 +52,7 @@ ul.order-base li span.am-badge{position: absolute; top: -7px; left: 55%;}
...
@@ -52,6 +52,7 @@ ul.order-base li span.am-badge{position: absolute; top: -7px; left: 55%;}
.user-base-right
{
position
:
absolute
;
right
:
10px
;
top
:
10px
;}
.user-base-right
{
position
:
absolute
;
right
:
10px
;
top
:
10px
;}
ul
.user-base-icon
{
left
:
0
;
bottom
:
0
;
width
:
100%
;
padding
:
5px
0
;}
ul
.user-base-icon
{
left
:
0
;
bottom
:
0
;
width
:
100%
;
padding
:
5px
0
;}
ul
.user-base-icon
li
{
float
:
left
;
width
:
33.33%
;}
ul
.user-base-icon
li
{
float
:
left
;
width
:
33.33%
;}
.user-center-notice
{
margin
:
0
;
}
}
}
...
...
shopxo.sql
浏览文件 @
76c0a7b1
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录