Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
04c0ecf2
ShopXO
项目概览
jamesyang1999
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
04c0ecf2
编写于
11月 14, 2018
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
样式优化
上级
8af47aec
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
136 addition
and
26 deletion
+136
-26
service/Application/Home/View/Default/Order/Comments.html
service/Application/Home/View/Default/Order/Comments.html
+13
-9
service/Application/Home/View/Default/User/Index.html
service/Application/Home/View/Default/User/Index.html
+2
-1
service/Application/Service/OrderService.class.php
service/Application/Service/OrderService.class.php
+91
-2
service/Public/Home/Default/Css/Buy.css
service/Public/Home/Default/Css/Buy.css
+3
-3
service/Public/Home/Default/Css/Order.Comments.css
service/Public/Home/Default/Css/Order.Comments.css
+22
-5
service/Public/Home/Default/Css/Order.Detail.css
service/Public/Home/Default/Css/Order.Detail.css
+3
-3
service/Public/Home/Default/Css/Order.css
service/Public/Home/Default/Css/Order.css
+0
-1
service/Public/Home/Default/Css/User.Index.css
service/Public/Home/Default/Css/User.Index.css
+1
-1
service/Public/Home/Default/Js/Order.js
service/Public/Home/Default/Js/Order.js
+1
-1
未找到文件。
service/Application/Home/View/Default/Order/Comments.html
浏览文件 @
04c0ecf2
...
...
@@ -69,16 +69,20 @@
<p
class=
"line-price"
>
¥{{$goods.price}} x {{$goods.buy_number}}
</p>
</td>
<td>
<ul
class=
"rating"
>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
</ul>
<div
class=
"am-form-group rating-items"
>
<ul
class=
"rating"
>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
<li><i
class=
"am-icon-star-o am-icon-md"
></i></li>
</ul>
<input
type=
"text"
name=
"rating[]"
value=
""
class=
"input-rating"
data-validation-message=
"请选择评分"
required
/>
</div>
<div
class=
"am-form-group"
>
<textarea
name=
"content[]"
class=
"am-radius"
rows=
"4"
minlength=
"6"
maxlength=
"200"
data-validation-message=
"评价内容 6~200 个字符之间"
required
></textarea>
</div>
<input
type=
"hidden"
name=
"goods_id[]"
value=
"{{$goods.goods_id}}"
/>
<input
type=
"hidden"
name=
"rating[]"
value=
"0"
class=
"input-rating"
/>
<textarea
name=
"content[]"
class=
"am-radius"
rows=
"4"
maxlength=
"200"
data-validation-message=
"最多200个字符"
></textarea>
</td>
</tr>
</foreach>
...
...
service/Application/Home/View/Default/User/Index.html
浏览文件 @
04c0ecf2
...
...
@@ -48,7 +48,8 @@
</div>
</div>
<div
class=
"user-base-right"
>
<a
href=
"{{:U('Home/Message/Index')}}"
class=
"am-icon-bell-o message"
>
消息
<if
condition=
"$common_message_total gt 0"
>
{{$common_message_total}}
</if></a>
<a
href=
"javascript:;"
class=
"am-icon-fire"
>
积分198
</a>
<a
href=
"{{:U('Home/Message/Index')}}"
class=
"am-icon-bell-o message"
>
消息
<if
condition=
"$common_message_total gt 0"
>
{{$common_message_total}}
</if></a>
</div>
<ul
class=
"user-base-icon"
>
<li>
...
...
service/Application/Service/OrderService.class.php
浏览文件 @
04c0ecf2
...
...
@@ -671,7 +671,7 @@ class OrderService
if
(
$m
->
where
(
$where
)
->
save
(
$upd_data
))
{
// 库存扣除
$ret
=
BuyService
::
OrderInventoryRollback
([
'order_id'
=>
$
params
[
'id'
],
'order_data'
=>
$upd_data
]);
$ret
=
BuyService
::
OrderInventoryRollback
([
'order_id'
=>
$
order
[
'id'
],
'order_data'
=>
$upd_data
]);
if
(
$ret
[
'status'
]
!=
0
)
{
// 事务回滚
...
...
@@ -763,7 +763,7 @@ class OrderService
if
(
$m
->
where
(
$where
)
->
save
(
$upd_data
))
{
// 库存扣除
$ret
=
BuyService
::
OrderInventoryDeduct
([
'order_id'
=>
$
params
[
'id'
],
'order_data'
=>
$upd_data
]);
$ret
=
BuyService
::
OrderInventoryDeduct
([
'order_id'
=>
$
order
[
'id'
],
'order_data'
=>
$upd_data
]);
if
(
$ret
[
'status'
]
!=
0
)
{
// 事务回滚
...
...
@@ -833,6 +833,9 @@ class OrderService
return
DataReturn
(
'状态不可操作['
.
$status_text
.
']'
,
-
1
);
}
// 开启事务
$m
->
startTrans
();
// 更新订单状态
$upd_data
=
[
'status'
=>
4
,
...
...
@@ -841,6 +844,15 @@ class OrderService
];
if
(
$m
->
where
(
$where
)
->
save
(
$upd_data
))
{
// 订单商品积分赠送
$ret
=
self
::
OrderGoodsIntegralGiving
([
'order_id'
=>
$order
[
'id'
]]);
if
(
$ret
[
'status'
]
!=
0
)
{
// 事务回滚
$m
->
rollback
();
return
DataReturn
(
$ret
[
'msg'
],
-
10
);
}
// 用户消息
MessageService
::
MessageAdd
(
$order
[
'user_id'
],
'订单收货'
,
'订单收货成功'
,
1
,
$order
[
'id'
]);
...
...
@@ -848,8 +860,14 @@ class OrderService
$creator
=
isset
(
$params
[
'creator'
])
?
intval
(
$params
[
'creator'
])
:
0
;
$creator_name
=
isset
(
$params
[
'creator_name'
])
?
htmlentities
(
$params
[
'creator_name'
])
:
''
;
self
::
OrderHistoryAdd
(
$order
[
'id'
],
$upd_data
[
'status'
],
$order
[
'status'
],
'收货'
,
$creator
,
$creator_name
);
// 提交事务
$m
->
commit
();
return
DataReturn
(
L
(
'common_operation_collect_success'
),
0
);
}
// 事务回滚
$m
->
rollback
();
return
DataReturn
(
L
(
'common_operation_collect_error'
),
-
1
);
}
...
...
@@ -1212,5 +1230,76 @@ class OrderService
return
DataReturn
(
'处理成功'
,
0
,
$result
);
}
/**
* 订单商品积分赠送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-14
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
OrderGoodsIntegralGiving
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'order_id'
,
'error_msg'
=>
'订单id有误'
,
]
];
$ret
=
params_checked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 订单
$order
=
M
(
'Order'
)
->
field
(
'id,user_id,status'
)
->
find
(
intval
(
$params
[
'order_id'
]));
if
(
empty
(
$order
))
{
return
DataReturn
(
'订单不存在或已删除,中止操作'
,
0
);
}
if
(
!
in_array
(
$order
[
'status'
],
[
4
]))
{
return
DataReturn
(
'当前订单状态不允许操作['
.
$params
[
'order_id'
]
.
'-'
.
$order
[
'status'
]
.
']'
,
0
);
}
// 获取用户信息
$user_m
=
M
(
'User'
);
$user
=
$user_m
->
field
(
'id'
)
->
find
(
intval
(
$order
[
'user_id'
]));
if
(
empty
(
$user
))
{
return
DataReturn
(
'用户不存在或已删除,中止操作'
,
0
);
}
// 获取订单商品
$goods_all
=
M
(
'OrderDetail'
)
->
where
([
'order_id'
=>
$params
[
'order_id'
]])
->
getField
(
'goods_id'
,
true
);
if
(
!
empty
(
$goods_all
))
{
$goods_m
=
M
(
'Goods'
);
$log_m
=
M
(
'OrderGoodsInventoryLog'
);
foreach
(
$goods_all
as
$goods_id
)
{
$give_integral
=
$goods_m
->
where
([
'id'
=>
$goods_id
])
->
getField
(
'give_integral'
);
if
(
!
empty
(
$give_integral
))
{
// 用户积分添加
$user_integral
=
$user_m
->
where
([
'id'
=>
$user
[
'id'
]])
->
getField
(
'integral'
);
if
(
!
$user_m
->
where
([
'id'
=>
$user
[
'id'
]])
->
setInc
(
'integral'
,
$give_integral
))
{
return
DataReturn
(
'用户积分赠送失败['
.
$params
[
'order_id'
]
.
'-'
.
$goods_id
.
']'
,
-
10
);
}
// 积分日志
UserService
::
UserIntegralLogAdd
(
$user
[
'id'
],
$user_integral
,
$user_integral
+
$give_integral
,
'订单商品完成赠送'
,
1
);
}
}
return
DataReturn
(
'操作成功'
,
0
);
}
return
DataReturn
(
'没有需要操作的数据'
,
0
);
}
}
?>
\ No newline at end of file
service/Public/Home/Default/Css/Buy.css
浏览文件 @
04c0ecf2
...
...
@@ -147,11 +147,11 @@ ul.address-list, .business-item ul { overflow: hidden; }
/**
* 商品列表
*/
.goods-detail
img
{
width
:
80px
;
height
:
80px
;
}
.goods-detail
{
position
:
relative
;
}
.goods-detail
img
{
width
:
80px
;
height
:
80px
;
position
:
absolute
;
}
.goods-detail
{
position
:
relative
;
min-height
:
80px
;
}
.goods-title
{
display
:
block
;
max-height
:
36px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.goods-title
:hover
{
text-decoration
:
underline
;
}
.goods-base
{
position
:
absolute
;
top
:
0
;
left
:
85px
;
}
.goods-base
{
float
:
left
;
top
:
0
;
margin-
left
:
85px
;
}
.goods-attr
{
margin-top
:
5px
;
}
.goods-attr
li
{
color
:
#888
;
line-height
:
16px
;
}
.original-price
,
.line-price
{
font-family
:
Verdana
,
Tahoma
,
arial
;
}
...
...
service/Public/Home/Default/Css/Order.Comments.css
浏览文件 @
04c0ecf2
ul
.rating
{
overflow
:
hidden
;
margin-bottom
:
2px
;
padding
:
3px
5px
;
}
ul
.rating
li
{
float
:
left
;
...
...
@@ -12,17 +13,28 @@ ul.rating li i.am-icon-star-o {
ul
.rating
li
i
.am-icon-star
{
color
:
#d13b49
;
}
.rating-items
{
margin-bottom
:
0
;
}
.rating-items
.input-rating
{
position
:
fixed
;
top
:
-10000px
;
left
:
-10000px
;
}
.rating-items.am-form-error
ul
.rating
{
background-color
:
#ffe7e7
;
}
/**
* 商品列表
*/
.order-goods
.base
{
width
:
50%
;
}
.order-goods
{
margin-top
:
20px
;
}
.goods-detail
img
{
width
:
80px
;
height
:
80px
;
}
.goods-detail
{
position
:
relative
;
}
.goods-detail
img
{
width
:
80px
;
height
:
80px
;
position
:
absolute
;
}
.goods-detail
{
position
:
relative
;
min-height
:
80px
;
}
.goods-title
{
display
:
block
;
max-height
:
36px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.goods-title
:hover
{
text-decoration
:
underline
;
}
.goods-base
{
position
:
absolute
;
top
:
0
;
left
:
85px
;
}
.goods-base
{
float
:
left
;
top
:
0
;
margin-
left
:
85px
;
}
.goods-attr
{
margin-top
:
5px
;
}
.goods-attr
li
{
color
:
#888
;
line-height
:
16px
;
}
.original-price
,
.line-price
{
font-family
:
Verdana
,
Tahoma
,
arial
;
}
...
...
@@ -40,4 +52,9 @@ strong.total-price-content { color: #d2364c; font-size: 16px; }
.cart-content
table
tr
.number
{
width
:
20%
;
}
.cart-content
table
tr
.total-price
{
width
:
20%
;
}
.cart-content
{
margin-top
:
20px
;
}
}
\ No newline at end of file
}
@media
only
screen
and
(
max-width
:
640px
)
{
.goods-detail
img
{
width
:
60px
;
height
:
60px
;
}
.goods-base
{
margin-left
:
65px
;
}
.goods-detail
{
min-height
:
60px
;
}
}
\ No newline at end of file
service/Public/Home/Default/Css/Order.Detail.css
浏览文件 @
04c0ecf2
...
...
@@ -189,11 +189,11 @@ ul.progress li.current .title {
* 商品列表
*/
.order-goods
{
margin-top
:
20px
;
}
.goods-detail
img
{
width
:
80px
;
height
:
80px
;
}
.goods-detail
{
position
:
relative
;
}
.goods-detail
img
{
width
:
80px
;
height
:
80px
;
position
:
absolute
;
}
.goods-detail
{
position
:
relative
;
min-height
:
80px
;
}
.goods-title
{
display
:
block
;
max-height
:
36px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.goods-title
:hover
{
text-decoration
:
underline
;
}
.goods-base
{
position
:
absolute
;
top
:
0
;
left
:
85px
;
}
.goods-base
{
float
:
left
;
top
:
0
;
margin-
left
:
85px
;
}
.goods-attr
{
margin-top
:
5px
;
}
.goods-attr
li
{
color
:
#888
;
line-height
:
16px
;
}
.original-price
,
.line-price
{
font-family
:
Verdana
,
Tahoma
,
arial
;
}
...
...
service/Public/Home/Default/Css/Order.css
浏览文件 @
04c0ecf2
...
...
@@ -91,7 +91,6 @@ table.data-ongoing .base-operate { border-top: 1px dashed #fff1f5; }
*/
.goods-detail
{
position
:
relative
;
min-height
:
80px
;
}
.goods-detail
img
{
width
:
80px
;
height
:
80px
;
position
:
absolute
;
}
.goods-detail
{
position
:
relative
;
}
.goods-title
{
display
:
block
;
max-height
:
36px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.goods-title
:hover
{
text-decoration
:
underline
;
}
.goods-base
{
float
:
left
;
top
:
0
;
margin-left
:
85px
;
}
...
...
service/Public/Home/Default/Css/User.Index.css
浏览文件 @
04c0ecf2
...
...
@@ -47,7 +47,7 @@ ul.order-base li span.am-badge{position: absolute; top: -7px; left: 55%;}
.nav-search
{
display
:
none
;}
.user-main
{
padding-top
:
0
;}
.user-content-body
{
padding
:
0
;}
.user-base
{
text-align
:
center
;
height
:
210px
;}
.user-avatar
{
margin-bottom
:
10px
;}
.user-avatar
{
margin-bottom
:
10px
;
margin-top
:
10px
;
}
.user-base-left
.items
a
:not
(
:last-child
)
{
margin-right
:
20px
;}
.user-base-right
{
position
:
absolute
;
right
:
10px
;
top
:
10px
;}
ul
.user-base-icon
{
left
:
0
;
bottom
:
0
;
width
:
100%
;
padding
:
5px
0
;}
...
...
service/Public/Home/Default/Js/Order.js
浏览文件 @
04c0ecf2
...
...
@@ -56,7 +56,7 @@ $(function()
{
$
(
this
).
parent
().
find
(
'
li
'
).
eq
(
i
).
find
(
'
i
'
).
removeClass
(
'
am-icon-star-o
'
).
addClass
(
'
am-icon-star
'
);
}
$
(
this
).
parents
(
'
td
'
).
find
(
'
input.input-rating
'
).
val
(
index
+
1
);
$
(
this
).
parents
(
'
td
'
).
find
(
'
input.input-rating
'
).
val
(
index
+
1
)
.
trigger
(
'
blur
'
)
;
});
// 是否自动开启支付窗口
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录