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
17424c5d
Commit
17424c5d
authored
Jan 03, 2019
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
c0462517
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+8
-1
OrderService.php
application/models/Business/Order/OrderService.php
+7
-2
PaymentService.php
application/models/Business/Order/PaymentService.php
+1
-1
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
17424c5d
...
@@ -1202,11 +1202,12 @@ class OrderConfirmUtil {
...
@@ -1202,11 +1202,12 @@ class OrderConfirmUtil {
}
}
$orderCon
=
array
(
'pay_sn'
=>
$paySn
,
'order_state'
=>
array
(
'in'
,
array
(
\Our\ApiConst
::
orderStateWaitPay
,
ApiConst
::
orderStateCancel
)));
$orderCon
=
array
(
'pay_sn'
=>
$paySn
,
'order_state'
=>
array
(
'in'
,
array
(
\Our\ApiConst
::
orderStateWaitPay
,
ApiConst
::
orderStateCancel
)));
$orderList
=
$orderModel
->
getListByCon
(
$orderCon
,
'order_id,
coupon_id,buyer_id,store_id,order_sn
'
);
$orderList
=
$orderModel
->
getListByCon
(
$orderCon
,
'order_id,
order_sn, store_name, buyer_id, order_amount, payment_time, order_state, prepay_id,coupon_id
'
);
if
(
!
$orderList
){
if
(
!
$orderList
){
$errorCode
=
\Error\CodeConfigModel
::
noOrderListForPay
;
$errorCode
=
\Error\CodeConfigModel
::
noOrderListForPay
;
return
array
(
'flag'
=>
\Our\ApiConst
::
zero
,
'errorCode'
=>
$errorCode
,
'data'
=>
$data
);
return
array
(
'flag'
=>
\Our\ApiConst
::
zero
,
'errorCode'
=>
$errorCode
,
'data'
=>
$data
);
}
}
$order
=
$orderList
[
0
];
$memberId
=
$orderList
[
0
][
'buyer_id'
];
$memberId
=
$orderList
[
0
][
'buyer_id'
];
$updateOrder
=
array
();
$updateOrder
=
array
();
$updateOrder
[
'order_state'
]
=
\Our\ApiConst
::
orderStateWaitConfirm
;
$updateOrder
[
'order_state'
]
=
\Our\ApiConst
::
orderStateWaitConfirm
;
...
@@ -1242,6 +1243,12 @@ class OrderConfirmUtil {
...
@@ -1242,6 +1243,12 @@ class OrderConfirmUtil {
}*/
}*/
$orderModel
->
db
->
doCommit
();
$orderModel
->
db
->
doCommit
();
//支付支付成功微信小程序模板消息
$settingDAO
=
\DAO\SettingModel
::
getInstance
();
$msg_tpl
=
$settingDAO
->
getListCache
(
array
(
'wxapp_order_paysucc_tpl'
))[
'wxapp_order_paysucc_tpl'
];
\Business\Order\OrderServiceModel
::
getInstance
()
->
sendPaymentMessage
(
$order
,
$msg_tpl
);
//发送订单消息
$this
->
deleteCacheInfo
(
$memberId
);
$this
->
deleteCacheInfo
(
$memberId
);
$this
->
pushMessage
();
$this
->
pushMessage
();
return
array
(
'flag'
=>
\Our\ApiConst
::
one
,
'errorCode'
=>
$errorCode
);
return
array
(
'flag'
=>
\Our\ApiConst
::
one
,
'errorCode'
=>
$errorCode
);
...
...
application/models/Business/Order/OrderService.php
View file @
17424c5d
...
@@ -128,9 +128,10 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -128,9 +128,10 @@ class OrderServiceModel extends \Business\AbstractModel
if
(
$json
[
'errmsg'
]
==
'ok'
)
{
if
(
$json
[
'errmsg'
]
==
'ok'
)
{
$model
->
updateByOrderId
(
array
(
'msg_status'
=>
2
),
$order
[
'order_id'
]);
$model
->
updateByOrderId
(
array
(
'msg_status'
=>
2
),
$order
[
'order_id'
]);
// echo 'order[' . $order['order_id'] .'] send payment succ'."\n";
// echo 'order[' . $order['order_id'] .'] send payment succ'."\n";
return
true
;
}
}
}
}
return
false
;
}
}
public
function
sendShippingMessage
(
$order
,
$msg_tpl
)
{
public
function
sendShippingMessage
(
$order
,
$msg_tpl
)
{
...
@@ -174,9 +175,11 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -174,9 +175,11 @@ class OrderServiceModel extends \Business\AbstractModel
if
(
$json
[
'errmsg'
]
==
'ok'
)
{
if
(
$json
[
'errmsg'
]
==
'ok'
)
{
$model
->
updateByOrderId
(
array
(
'msg_status'
=>
3
),
$order
[
'order_id'
]);
$model
->
updateByOrderId
(
array
(
'msg_status'
=>
3
),
$order
[
'order_id'
]);
// echo 'order[' . $order['order_id'] .'] send shipping succ'."\n";
// echo 'order[' . $order['order_id'] .'] send shipping succ'."\n";
return
true
;
}
}
}
}
return
false
;
}
}
...
@@ -230,9 +233,11 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -230,9 +233,11 @@ class OrderServiceModel extends \Business\AbstractModel
if
(
$json
[
'errmsg'
]
==
'ok'
)
{
if
(
$json
[
'errmsg'
]
==
'ok'
)
{
$model
->
updateByOrderId
(
array
(
'msg_status'
=>
4
),
$order
[
'order_id'
]);
$model
->
updateByOrderId
(
array
(
'msg_status'
=>
4
),
$order
[
'order_id'
]);
// echo 'order[' . $order['order_id'] .'] send reciver succ'."\n";
// echo 'order[' . $order['order_id'] .'] send reciver succ'."\n";
return
true
;
}
}
}
}
return
false
;
}
}
/**
/**
...
@@ -251,7 +256,7 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -251,7 +256,7 @@ class OrderServiceModel extends \Business\AbstractModel
//付款7天内付款消息通知
//付款7天内付款消息通知
$where
=
array
(
'msg_status'
=>
array
(
'elt'
,
1
),
'payment_type'
=>
5
,
'order_state'
=>
array
(
'egt'
,
20
),
'prepay_id'
=>
$where
=
array
(
'msg_status'
=>
array
(
'elt'
,
1
),
'payment_type'
=>
5
,
'order_state'
=>
array
(
'egt'
,
20
),
'prepay_id'
=>
array
(
'neq'
,
array
(
'neq'
,
''
),
'payment_time'
=>
array
(
'
gt'
,
TIMESTAMP
-
7
*
24
*
60
*
6
0
));
''
),
'payment_time'
=>
array
(
'
between'
,
TIMESTAMP
-
7
*
24
*
60
*
60
,
TIMESTAMP
-
1
0
));
if
(
$list
=
$model
->
getList
(
$where
,
'order_id,order_sn, store_name, buyer_id, order_amount, payment_time, order_state, prepay_id'
,
0
,
10
,
array
(
'payment_time'
=>
'asc'
)))
{
if
(
$list
=
$model
->
getList
(
$where
,
'order_id,order_sn, store_name, buyer_id, order_amount, payment_time, order_state, prepay_id'
,
0
,
10
,
array
(
'payment_time'
=>
'asc'
)))
{
echo
'order count: '
.
count
(
$list
[
'list'
])
.
"
\n
"
;
echo
'order count: '
.
count
(
$list
[
'list'
])
.
"
\n
"
;
$msg_tpl
=
$wxapp_templates
[
'wxapp_order_paysucc_tpl'
];
$msg_tpl
=
$wxapp_templates
[
'wxapp_order_paysucc_tpl'
];
...
...
application/models/Business/Order/PaymentService.php
View file @
17424c5d
...
@@ -145,4 +145,4 @@ class PaymentServiceModel extends \Business\AbstractModel{
...
@@ -145,4 +145,4 @@ class PaymentServiceModel extends \Business\AbstractModel{
return
self
::
$_instance
;
return
self
::
$_instance
;
}
}
}
}
\ No newline at end of file
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