Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
7c5d3d85
Commit
7c5d3d85
authored
Sep 26, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into ccw
parents
b7c1e007
c3ef29a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+27
-1
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
7c5d3d85
...
...
@@ -43,6 +43,8 @@ class OrderConfirmUtil {
private
$cartCacheDeleteFlag
=
false
;
private
$pushMessageOrders
=
array
();
public
function
addOrder
(
$data
,
$memberId
,
$currentAddress
){
$storeCartData
=
$this
->
checkPostData
(
$data
,
$memberId
,
$currentAddress
);
//return $storeCartData;
...
...
@@ -349,6 +351,7 @@ class OrderConfirmUtil {
$orderLogList
=
array
();
$needPayFlag
=
\Our\ApiConst
::
zero
;
$giftCoupons
=
array
();
$this
->
pushMessageOrders
=
array
();
foreach
(
$storeCartData
[
'cartList'
]
as
$storeId
=>
$storeCarts
){
$order
=
array
();
$order
[
'order_sn'
]
=
$this
->
makeOrderSn
(
$orderPayResult
);
...
...
@@ -391,6 +394,13 @@ class OrderConfirmUtil {
$orderModel
->
db
->
doRollback
();
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
saveOrderPayFailed
);
}
if
(
$order
[
'order_state'
]
==
\Our\ApiConst
::
orderStateWaitConfirm
){
$tempPushOrder
=
array
();
$tempPushOrder
[
'orderId'
]
=
$orderId
;
$tempPushOrder
[
'orderSn'
]
=
$order
[
'order_sn'
];
$tempPushOrder
[
'storeId'
]
=
$storeId
;
$this
->
pushMessageOrders
[]
=
$tempPushOrder
;
}
$orderLog
=
array
();
$orderLog
[
'order_id'
]
=
$orderId
;
$orderLog
[
'log_msg'
]
=
\Our\DescribeConst
::
addOrderLog
;
...
...
@@ -512,9 +522,18 @@ class OrderConfirmUtil {
}
$orderModel
->
db
->
doCommit
();
$this
->
opCacheInfo
();
$this
->
pushMessage
();
return
array
(
'needPayFlag'
=>
$needPayFlag
,
'paySn'
=>
$paySn
);
}
public
function
pushMessage
(){
if
(
$this
->
pushMessageOrders
){
$orderService
=
\Business\Order\OrderServiceModel
::
getInstance
();
foreach
(
$this
->
pushMessageOrders
as
$tempOrder
){
$orderService
->
pushRecieveOrder
(
$tempOrder
);
}
}
}
public
function
opCacheInfo
(){
if
(
$this
->
cartCacheDeleteFlag
){
$this
->
delCartCache
();
...
...
@@ -921,7 +940,7 @@ class OrderConfirmUtil {
}
$orderCon
=
array
(
'pay_sn'
=>
$paySn
,
'order_state'
=>
\Our\ApiConst
::
orderStateWaitPay
);
$orderList
=
$orderModel
->
getListByCon
(
$orderCon
,
'order_id,coupon_id,buyer_id'
);
$orderList
=
$orderModel
->
getListByCon
(
$orderCon
,
'order_id,coupon_id,buyer_id
,store_id,order_sn
'
);
if
(
!
$orderList
){
$errorCode
=
\Error\CodeConfigModel
::
noOrderListForPay
;
return
array
(
'flag'
=>
\Our\ApiConst
::
zero
,
'errorCode'
=>
$errorCode
,
'data'
=>
$data
);
...
...
@@ -941,12 +960,18 @@ class OrderConfirmUtil {
}
//更新订单支付状态
$couponIds
=
array
();
$this
->
pushMessageOrders
=
array
();
foreach
(
$orderList
as
$tempOrder
){
if
(
$tempOrder
[
'coupon_id'
]
>
\Our\ApiConst
::
zero
){
$couponIds
[
$tempOrder
[
'order_id'
]]
=
$tempOrder
[
'coupon_id'
];
}
$orderModel
->
deleteOrderCache
(
$tempOrder
[
'buyer_id'
],
$tempOrder
[
'order_id'
],
$tempOrder
[
'store_id'
],
true
,
true
);
\Our\RedisHelper
::
memberTotalFromStateToState
(
$tempOrder
[
'buyer_id'
],
ApiConst
::
orderStateWaitPay
,
ApiConst
::
orderStateWaitConfirm
);
$tempPushOrder
=
array
();
$tempPushOrder
[
'orderId'
]
=
$tempOrder
[
'order_id'
];
$tempPushOrder
[
'orderSn'
]
=
$tempOrder
[
'order_sn'
];
$tempPushOrder
[
'storeId'
]
=
$tempOrder
[
'store_id'
];
$this
->
pushMessageOrders
[]
=
$tempPushOrder
;
}
//送券、送礼品
/*if($couponIds){
...
...
@@ -955,6 +980,7 @@ class OrderConfirmUtil {
$orderModel
->
db
->
doCommit
();
$this
->
deleteCacheInfo
(
$memberId
);
$this
->
pushMessage
();
return
array
(
'flag'
=>
\Our\ApiConst
::
one
,
'errorCode'
=>
$errorCode
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment