作者 Cool
1 个管道 的构建 通过 耗费 2 秒

模板消息注释

... ... @@ -333,18 +333,18 @@ class Api
*/
public function wxsendmessage($open_id, $data, $templateId,$url)
{
if (empty($open_id) || empty($data) || empty($templateId)) {
return false;
}
$app = new Application(ConfigService::load());
$notice = $app->notice;
$userId = $open_id;
$userService = $app->user;
$user = $userService->get($open_id);
// 判断是否关注公众号
if($user->subscribe == 1) {
$notice->uses($templateId)->withUrl($url)->andData($data)->andReceiver($userId)->send();
}
// if (empty($open_id) || empty($data) || empty($templateId)) {
// return false;
// }
// $app = new Application(ConfigService::load());
// $notice = $app->notice;
// $userId = $open_id;
// $userService = $app->user;
// $user = $userService->get($open_id);
// // 判断是否关注公众号
// if($user->subscribe == 1) {
// $notice->uses($templateId)->withUrl($url)->andData($data)->andReceiver($userId)->send();
// }
return true;
}
}
... ...