Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
f5476fe6
ShopXO
项目概览
jcy2004x
/
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,体验更适合开发者的 AI 搜索 >>
提交
f5476fe6
编写于
8月 14, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
订单逻辑优化
上级
7a3e9868
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
12 deletion
+51
-12
application/service/BuyService.php
application/service/BuyService.php
+36
-5
application/service/PaymentService.php
application/service/PaymentService.php
+1
-1
application/tags.php
application/tags.php
+8
-0
public/static/index/default/css/order.css
public/static/index/default/css/order.css
+6
-6
未找到文件。
application/service/BuyService.php
浏览文件 @
f5476fe6
...
...
@@ -629,12 +629,16 @@ class BuyService
// price 金额
// type 类型(0减少, 1增加)
// tips 提示信息
// business 业务类型(内容格式不限)
// ext 扩展数据(内容格式不限)
$extension_data
=
[
// [
// 'name' => '感恩节9折',
// 'price' => 23,
// 'type' => 0,
// 'tips' => '-¥23元'
// 'name' => '感恩节9折',
// 'price' => 23,
// 'type' => 0,
// 'tips' => '-¥23元',
// 'business' => null,
// 'ext' => null,
// ],
];
...
...
@@ -829,6 +833,20 @@ class BuyService
$order
[
'confirm_time'
]
=
time
();
}
// 订单添加前钩子
$hook_name
=
'plugins_service_buy_order_insert_begin'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'order'
=>
&
$order
,
'params'
=>
$params
,
]);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 开始事务
Db
::
startTrans
();
...
...
@@ -886,9 +904,22 @@ class BuyService
// 删除购物车
self
::
BuyCartDelete
(
$params
);
// 获取数据库订单信息
$order
=
Db
::
name
(
'Order'
)
->
find
(
$order_id
);
// 订单添加成功钩子, 不校验返回值
$hook_name
=
'plugins_service_buy_order_insert_success'
;
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'order_id'
=>
$order_id
,
'order'
=>
$order
,
'params'
=>
$params
,
]);
// 返回信息
$result
=
[
'order'
=>
Db
::
name
(
'Order'
)
->
find
(
$order_id
)
,
'order'
=>
$order
,
'jump_url'
=>
MyUrl
(
'index/order/index'
),
];
...
...
application/service/PaymentService.php
浏览文件 @
f5476fe6
...
...
@@ -595,7 +595,7 @@ class PaymentService
// 权限
if
(
!
is_writable
(
$file
))
{
return
DataReturn
(
'没操作权限'
,
-
3
);
return
DataReturn
(
'没操作权限
['
.
$file
.
']
'
,
-
3
);
}
// 删除
...
...
application/tags.php
浏览文件 @
f5476fe6
...
...
@@ -61,5 +61,13 @@ return array (
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_buy_handle'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_form_inside'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
);
?>
\ No newline at end of file
public/static/index/default/css/order.css
浏览文件 @
f5476fe6
...
...
@@ -47,12 +47,12 @@ table.data-list .base-operate { border-top: 1px dashed #eee; }
/* 进行中 */
table
.data-ongoing
{
border
:
1px
solid
#
fff1f5
;
}
table
.data-ongoing
td
.row-number
,
table
.data-ongoing
td
.row-total-price
,
table
.data-ongoing
td
.row-status
,
table
.data-ongoing
td
.row-operate
{
border-right
:
1px
solid
#
fff1f5
;
}
table
.data-ongoing
td
{
border-bottom
:
1px
solid
#
fff1f5
;
}
table
.data-ongoing
.content-hd
td
{
background
:
#
fff1f5
;
border-bottom-color
:
#fff1f5
;
}
table
.data-ongoing
:hover
{
box-shadow
:
0
1px
1px
#
ffd6e2
;
background
:
#fffbfc
;
}
table
.data-ongoing
.base-operate
{
border-top
:
1px
dashed
#
fff1f5
;
}
table
.data-ongoing
{
border
:
1px
solid
#
daf3ff
;
}
table
.data-ongoing
td
.row-number
,
table
.data-ongoing
td
.row-total-price
,
table
.data-ongoing
td
.row-status
,
table
.data-ongoing
td
.row-operate
{
border-right
:
1px
solid
#
daf3ff
;
}
table
.data-ongoing
td
{
border-bottom
:
1px
solid
#
daf3ff
;
}
table
.data-ongoing
.content-hd
td
{
background
:
#
eaf8ff
;
border-bottom-color
:
#daf3ff
;
}
table
.data-ongoing
:hover
{
box-shadow
:
0
1px
1px
#
aed8ff
;
background
:
#f7fdff
;
}
table
.data-ongoing
.base-operate
{
border-top
:
1px
dashed
#
daf3ff
;
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录