|
@@ -9,7 +9,9 @@ |
|
@@ -9,7 +9,9 @@ |
9
|
namespace app\admin\controller;
|
9
|
namespace app\admin\controller;
|
10
|
|
10
|
|
11
|
|
11
|
|
|
|
12
|
+use app\user\model\UserModel;
|
12
|
use cmf\controller\AdminBaseController;
|
13
|
use cmf\controller\AdminBaseController;
|
|
|
14
|
+use EasyWeChat\Foundation\Application;
|
13
|
|
15
|
|
14
|
|
16
|
|
15
|
/**
|
17
|
/**
|
|
@@ -91,6 +93,25 @@ class ApprovalController extends AdminBaseController |
|
@@ -91,6 +93,25 @@ class ApprovalController extends AdminBaseController |
91
|
$update['answer']=input('answer');
|
93
|
$update['answer']=input('answer');
|
92
|
$result=db('engage')->where($map)->update($update);
|
94
|
$result=db('engage')->where($map)->update($update);
|
93
|
if ($result==1){
|
95
|
if ($result==1){
|
|
|
96
|
+ /*发送模板消息*/
|
|
|
97
|
+ $user_id=db('engage')->where($map)->value('user_id');
|
|
|
98
|
+ $User=new UserModel();
|
|
|
99
|
+ $openid=$User->getUserOpenid();
|
|
|
100
|
+
|
|
|
101
|
+ $userId = $openid;
|
|
|
102
|
+ $templateId = 'M0PtJ9xxGWkMoCI6p1ZhQLyj83k3PAqkeG94yyMRxD4';
|
|
|
103
|
+ $url = 'http://overtrue.me';
|
|
|
104
|
+ $data = array(
|
|
|
105
|
+ "keyword1" => "恭喜你购买成功!",
|
|
|
106
|
+ "keyword2" => "巧克力",
|
|
|
107
|
+ "keyword3" => "39.8元",
|
|
|
108
|
+ "keyword4" => "欢迎再次购买!",
|
|
|
109
|
+ );
|
|
|
110
|
+
|
|
|
111
|
+ $Wechat=new Application();
|
|
|
112
|
+ $notice = $Wechat->notice;
|
|
|
113
|
+ $result = $notice->uses($templateId)->withUrl($url)->andData($data)->andReceiver($userId)->send();
|
|
|
114
|
+ var_dump($result);
|
94
|
$this->success('审核成功!');
|
115
|
$this->success('审核成功!');
|
95
|
}else{
|
116
|
}else{
|
96
|
$this->error('审核失败!');
|
117
|
$this->error('审核失败!');
|