...
|
...
|
@@ -9,7 +9,9 @@ |
|
|
namespace app\admin\controller;
|
|
|
|
|
|
|
|
|
use app\user\model\UserModel;
|
|
|
use cmf\controller\AdminBaseController;
|
|
|
use EasyWeChat\Foundation\Application;
|
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -91,6 +93,25 @@ class ApprovalController extends AdminBaseController |
|
|
$update['answer']=input('answer');
|
|
|
$result=db('engage')->where($map)->update($update);
|
|
|
if ($result==1){
|
|
|
/*发送模板消息*/
|
|
|
$user_id=db('engage')->where($map)->value('user_id');
|
|
|
$User=new UserModel();
|
|
|
$openid=$User->getUserOpenid();
|
|
|
|
|
|
$userId = $openid;
|
|
|
$templateId = 'M0PtJ9xxGWkMoCI6p1ZhQLyj83k3PAqkeG94yyMRxD4';
|
|
|
$url = 'http://overtrue.me';
|
|
|
$data = array(
|
|
|
"keyword1" => "恭喜你购买成功!",
|
|
|
"keyword2" => "巧克力",
|
|
|
"keyword3" => "39.8元",
|
|
|
"keyword4" => "欢迎再次购买!",
|
|
|
);
|
|
|
|
|
|
$Wechat=new Application();
|
|
|
$notice = $Wechat->notice;
|
|
|
$result = $notice->uses($templateId)->withUrl($url)->andData($data)->andReceiver($userId)->send();
|
|
|
var_dump($result);
|
|
|
$this->success('审核成功!');
|
|
|
}else{
|
|
|
$this->error('审核失败!');
|
...
|
...
|
|