作者 刘朕
1 个管道 的构建 通过 耗费 0 秒

合并分支 'liuzhen' 到 'master'

Liuzhen



查看合并请求 !94
... ... @@ -33,6 +33,7 @@
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-examine="{:$auth->check('user/user_withdraw/examine')}"
data-operate-edit="{:$auth->check('user/user_withdraw/edit')}"
data-operate-del="{:$auth->check('user/user_withdraw/del')}"
width="100%">
... ...
... ... @@ -474,6 +474,15 @@ class Hot extends Api
$insert['is_read_user'] = 1;
$res_msg = $msg_model->add($insert);
}
// 发送模板消息
// $send_data = array(
// "first" => '',
// 'keyword1' => '',
// "keyword2" => '',
// "keyword3" => date('Y-m-s',time()),
// "remark" => '',
// );
// $this->wxsendmessage('','','');
Db::commit();
} catch (PDOException $e) {
Db::rollback();
... ...
... ... @@ -1227,6 +1227,15 @@ class Store extends Api
'is_read_object' => 1,
];
$res_msg = $msg_model->edit($update);
// 发送模板消息
// $send_data = array(
// "first" => '',
// 'keyword1' => '',
// "keyword2" => '',
// "keyword3" => date('Y-m-s',time()),
// "remark" => '',
// );
// $this->wxsendmessage('','','');
Db::commit();
} catch (PDOException $e) {
Db::rollback();
... ...
... ... @@ -640,6 +640,15 @@ class User extends Api
'is_read_object' => 2,
];
$res_msg = $msg_model->edit($update);
// 发送模板消息
// $send_data = array(
// "first" => '',
// 'keyword1' => '',
// "keyword2" => '',
// "keyword3" => date('Y-m-s',time()),
// "remark" => '',
// );
// $this->wxsendmessage('','','');
Db::commit();
} catch (PDOException $e) {
Db::rollback();
... ...
... ... @@ -3,6 +3,7 @@
namespace app\common\controller;
use app\common\library\Auth;
use EasyWeChat\Foundation\Application;
use think\Config;
use think\exception\HttpResponseException;
use think\exception\ValidateException;
... ... @@ -320,4 +321,25 @@ class Api
return true;
}
/**
* 发送模板消息
* @param string $open_id 用户openid
* @param array $data 模板消息内容
* @param string $templateId 模板消息id
* @return bool
*/
public function wxsendmessage($open_id, $data, $templateId)
{
if (empty($open_id) || empty($data) || empty($templateId)) {
return false;
}
$options = get_addon_config('wechat');
$app = new Application($options);
$notice = $app->notice;
$userId = $open_id;
$url = config('option.vue_url').'/index/order/index.html';
$notice->uses($templateId)->withUrl($url)->andData($data)->andReceiver($userId)->send();
return true;
}
}
... ...
... ... @@ -7,4 +7,5 @@ return [
'updateTimelineShareData',
'chooseWXPay'
],
'vue_url' => 'http://shequ.h.brofirst.cn'
];
\ No newline at end of file
... ...