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
b6adf9dd
Commit
b6adf9dd
authored
Dec 29, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
50764f49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+1
-1
OrderService.php
application/models/Business/Order/OrderService.php
+16
-8
sendTemplateMessage.php
scripts/crontab/order/sendTemplateMessage.php
+1
-0
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
b6adf9dd
...
@@ -715,7 +715,7 @@ class OrderConfirmUtil {
...
@@ -715,7 +715,7 @@ class OrderConfirmUtil {
$msg_tpl
=
$settingDAO
->
getListCache
(
array
(
'wxapp_order_create_tpl'
))[
'wxapp_order_create_tpl'
];
$msg_tpl
=
$settingDAO
->
getListCache
(
array
(
'wxapp_order_create_tpl'
))[
'wxapp_order_create_tpl'
];
$goods_str
=
''
;
$goods_str
=
''
;
if
(
count
(
$goods_datas
)
>
1
)
{
if
(
count
(
$goods_datas
)
>
1
)
{
$goods_str
.=
$goods_datas
[
0
]
.
'等'
.
count
(
$goods_datas
)
.
'
个
商品'
;
$goods_str
.=
$goods_datas
[
0
]
.
'等'
.
count
(
$goods_datas
)
.
'
件
商品'
;
}
else
{
}
else
{
$goods_str
.=
$goods_datas
[
0
];
$goods_str
.=
$goods_datas
[
0
];
}
}
...
...
application/models/Business/Order/OrderService.php
View file @
b6adf9dd
...
@@ -147,7 +147,8 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -147,7 +147,8 @@ class OrderServiceModel extends \Business\AbstractModel
$settingDAO
=
\DAO\SettingModel
::
getInstance
();
$settingDAO
=
\DAO\SettingModel
::
getInstance
();
$access_token
=
$this
->
getLitAccesstoken
();
$access_token
=
$this
->
getLitAccesstoken
();
$where
=
array
(
'msg_status'
=>
1
,
'payment_type'
=>
1
,
'order_state'
=>
array
(
'gt'
,
10
),
'prepay_id'
=>
array
(
'neq'
,
$where
=
array
(
'msg_status'
=>
array
(
'elt'
,
1
),
'payment_type'
=>
1
,
'order_state'
=>
array
(
'gt'
,
10
),
'prepay_id'
=>
array
(
'neq'
,
''
));
''
));
$wxapp_templates
=
$settingDAO
->
getListCache
(
array
(
'wxapp_order_paysucc_tpl'
,
'wxapp_order_shipping_tpl'
,
'wxapp_order_receive_tpl'
));
$wxapp_templates
=
$settingDAO
->
getListCache
(
array
(
'wxapp_order_paysucc_tpl'
,
'wxapp_order_shipping_tpl'
,
'wxapp_order_receive_tpl'
));
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'
)))
{
...
@@ -165,15 +166,22 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -165,15 +166,22 @@ class OrderServiceModel extends \Business\AbstractModel
$req_data
=
array
(
'touser'
=>
$member
[
'member_wxopenid'
],
'template_id'
=>
$msg_tpl
,
$req_data
=
array
(
'touser'
=>
$member
[
'member_wxopenid'
],
'template_id'
=>
$msg_tpl
,
'form_id'
=>
$order
[
'prepay_id'
],
'form_id'
=>
$order
[
'prepay_id'
],
'data'
=>
array
(
'data'
=>
array
(
array
(
'keyword1'
=>
array
(
'value'
=>
$order
[
'order_sn'
])
),
'keyword1'
=>
array
(
'value'
=>
$order
[
'order_sn'
]
),
array
(
'keyword2'
=>
array
(
'value'
=>
$order
[
'store_name'
])
),
'keyword2'
=>
array
(
'value'
=>
$order
[
'store_name'
]
),
array
(
'keyword3'
=>
array
(
'value'
=>
$goods_str
)
),
'keyword3'
=>
array
(
'value'
=>
$goods_str
),
array
(
'keyword4'
=>
array
(
'value'
=>
number_format
(
$order
[
'order_amount'
]
/
100
,
2
)
)
.
'元'
),
'keyword4'
=>
array
(
'value'
=>
number_format
(
$order
[
'order_amount'
]
/
100
,
2
)
.
'元'
),
array
(
'keyword5'
=>
array
(
'value'
=>
date
(
'Y-m-d H:i'
,
$order
[
'payment_time'
])
)),
'keyword5'
=>
array
(
'value'
=>
date
(
'Y-m-d H:i'
,
$order
[
'payment_time'
]
)),
array
(
'keyword6'
=>
array
(
'value'
=>
'已付款'
)
),
'keyword6'
=>
array
(
'value'
=>
'已付款'
),
));
));
$url
=
'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token='
;
$url
=
'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token='
;
$result
=
$this
->
sendurl
(
$url
,
$access_token
,
$req_data
,
'post'
);
if
(
$result
=
$this
->
sendurl
(
$url
,
$access_token
,
$req_data
,
'post'
))
{
$json
=
json_decode
(
$result
,
true
);
if
(
$json
[
'errmsg'
]
==
'ok'
)
{
$model
->
updateByOrderId
(
$order
,
$order
[
'order_id'
]);
echo
'order['
.
$order
[
'order_id'
]
.
'] send payment succ'
.
"
\n
"
;
}
}
}
}
}
}
}
}
...
...
scripts/crontab/order/sendTemplateMessage.php
View file @
b6adf9dd
...
@@ -44,6 +44,7 @@ class cliOrderSendTemplateMessage extends basecli
...
@@ -44,6 +44,7 @@ class cliOrderSendTemplateMessage extends basecli
private
function
autoSendMessage
(){
private
function
autoSendMessage
(){
$service
=
\Business\Order\OrderServiceModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$service
=
\Business\Order\OrderServiceModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$service
->
baseDir
=
\Our\Common
::
getConfig
(
'out.config'
);
$service
->
baseDir
=
\Our\Common
::
getConfig
(
'out.config'
);
$service
->
sendTemplateMessage
();
}
}
protected
function
_runCli
()
protected
function
_runCli
()
...
...
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