Commit d0e8ac42 authored by wwccw0591's avatar wwccw0591

更新

parent c6313269
......@@ -727,15 +727,28 @@ class OrderConfirmUtil {
$authInfo = $sess->get('wxAuthInfo');
$openid = $authInfo['openid'];
$req_data = array('touser'=>$openid, 'template_id'=> $msg_tpl, 'form_id'=>$formId,
'page'=> 'pages/orders/detail/index?id=' . $orderId,
'data'=>array(
$tpl_datas = array();
if($msg_tpl=='') {
$tpl_datas = array(
'keyword1'=>array('value'=>'下单成功'),
'keyword2'=>array('value'=> $order['order_sn']),
'keyword3'=>array('value'=> number_format($order['order_amount']/100, 2).'元'),
'keyword4'=>array('value'=> $order['store_name']),
'keyword5'=>array('value'=> $goods_str),
));
);
} else {
$tpl_datas = array(
'keyword1'=>array('value'=>'下单成功'),
'keyword2'=>array('value'=> $order['order_sn']),
'keyword3'=>array('value'=> date('Y-m-d H:i', TIMESTAMP)),
'keyword4'=>array('value'=> number_format($order['order_amount']/100, 2).'元'),
'keyword5'=>array('value'=> $order['store_name']),
'keyword6'=>array('value'=> $goods_str),
);
}
$req_data = array('touser'=>$openid, 'template_id'=> $msg_tpl, 'form_id'=>$formId,
'page'=> 'pages/orders/detail/index?id=' . $orderId,
'data'=>$tpl_datas);
// \Our\Log::getInstance()->write(json_encode($req_data), '/data/log/apptest');
$json = $wechatCommon->sendTemplateMessage($access_token, $req_data);
// \Our\Log::getInstance()->write($json, '/data/log/apptest');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment