|
@@ -93,7 +93,7 @@ class Pay
|
|
'keyword2' => array('value' => '购买成功,您获得了 '.$journal['name'].' 的阅读资格!'),
|
|
'keyword2' => array('value' => '购买成功,您获得了 '.$journal['name'].' 的阅读资格!'),
|
|
);
|
|
);
|
|
$send['data'] = json_encode($send['data']);
|
|
$send['data'] = json_encode($send['data']);
|
|
- $send['form_id'] = Dever::load('act/lib/form')->get($uid, 2);
|
|
|
|
|
|
+ $send['form_id'] = Dever::load('act/lib/form')->get($uid, 2, $order['cate_id']);
|
|
|
|
|
|
if ($send['form_id']) {
|
|
if ($send['form_id']) {
|
|
Dever::load('wechat_applet/msg.send', $send);
|
|
Dever::load('wechat_applet/msg.send', $send);
|
|
@@ -105,4 +105,28 @@ class Pay
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function send_api()
|
|
|
|
+ {
|
|
|
|
+ $uid = Dever::input('uid', 8);
|
|
|
|
+ # 发模板消息
|
|
|
|
+ $wechat = Dever::db('passport/wechat')->one(array('uid' => $uid));
|
|
|
|
+ if ($wechat && Dever::project('wechat_applet')) {
|
|
|
|
+ $send['key'] = 'buy_journal';
|
|
|
|
+ $send['project_id'] = 2;
|
|
|
|
+ $send['touser'] = $wechat['openid'];
|
|
|
|
+ $send['page'] = Dever::config('base')->applet_index . '?scene=' . Dever::login($uid) . ',' . '4,' . $order['product_id'];
|
|
|
|
+ $send['data'] = array
|
|
|
|
+ (
|
|
|
|
+ 'keyword1' => array('value' => date('Y年m月d日 H:i', $order['cdate'])),
|
|
|
|
+ 'keyword2' => array('value' => '购买成功,您获得了 '.$journal['name'].' 的阅读资格!'),
|
|
|
|
+ );
|
|
|
|
+ $send['data'] = json_encode($send['data']);
|
|
|
|
+ $send['form_id'] = Dever::load('act/lib/form')->get($uid, 2, $order['cate_id']);
|
|
|
|
+
|
|
|
|
+ if ($send['form_id']) {
|
|
|
|
+ Dever::load('wechat_applet/msg.send', $send);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|