|
@@ -20,6 +20,40 @@ class Content extends Core
|
|
|
|
|
|
return 'ok';
|
|
|
}
|
|
|
+
|
|
|
+ public function test()
|
|
|
+ {
|
|
|
+ $journal = Dever::db('journal/info')->one(8);
|
|
|
+
|
|
|
+ $uid = Dever::input('uid');
|
|
|
+ $user = Dever::db('passport/user')->one($uid);
|
|
|
+ $wechat = Dever::db('passport/wechat')->one(array('uid' => $uid));
|
|
|
+
|
|
|
+ print_r($wechat);die;
|
|
|
+ if ($wechat && Dever::project('wechat_applet')) {
|
|
|
+ $send['key'] = 'buy_journal';
|
|
|
+ $send['project_id'] = 1;
|
|
|
+ $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['form_id'] = Dever::load('act/lib/form')->get($uid, 2);
|
|
|
+
|
|
|
+ if ($send['form_id']) {
|
|
|
+ Dever::load('wechat_applet/msg.send', $send);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (isset($user['mobile']) && $user['mobile'] && Dever::project('sms')) {
|
|
|
+ $send = array();
|
|
|
+ $send['name'] = $journal['name'];
|
|
|
+ Dever::load('sms/api.send', 'buy_journal', $user['mobile'], $send);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
public function home()
|
|
@@ -29,6 +63,7 @@ class Content extends Core
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
$this->data['menu'] = Dever::db('content/cate')->getAll();
|
|
|
|
|
|
|