| xqd
@@ -17,9 +17,9 @@ class sendNotice extends BatchAction
|
|
|
$openid = User::where('id',$model->id)->value('openid');
|
|
|
$content = request('content');
|
|
|
$remark= request('remark');
|
|
|
- $openid = 'oVxTzvgYlGktIDZXwfLMLQ01Tr5s';
|
|
|
+// $openid = 'oVxTzvgYlGktIDZXwfLMLQ01Tr5s'; 自己
|
|
|
if(empty($openid)) continue;
|
|
|
- $this->send($openid,$content,$remark);
|
|
|
+// $this->send($openid,$content,$remark);
|
|
|
}
|
|
|
|
|
|
return $this->response()->success('发送成功')->refresh();
|
| xqd
@@ -28,40 +28,37 @@ class sendNotice extends BatchAction
|
|
|
public function form()
|
|
|
{
|
|
|
$this->text('title','标题')->value('社区通知')->disable();
|
|
|
- $this->textarea('content','内容')->value('社区通州')->rows(4);
|
|
|
- $this->textarea('remark','备注')->value('社区通州')->rows(3);
|
|
|
+ $this->textarea('content','内容')->rows(4);
|
|
|
+ $this->textarea('remark','备注')->rows(3);
|
|
|
}
|
|
|
|
|
|
public function send($open_id,$cotent, $remark)
|
|
|
{
|
|
|
- if(empty($open_id)) return true;
|
|
|
- $config = [
|
|
|
+ if(empty($open_id)) return true;
|
|
|
+ $config = [
|
|
|
'app_id' => 'wx1c2357232cd25f65',
|
|
|
'secret' => 'c8cab53e4e52234ed1bc2abbdeaba57d',
|
|
|
-// 'app_id' => 'wx1c2357232cd25f65',
|
|
|
-// 'secret' => 'c8cab53e4e52234ed1bc2abbdeaba57d',
|
|
|
// 'app_id' => 'wx13bedfcc62e9bab0',
|
|
|
// 'secret' => '175e5518b6426dd12d3096f24ca68fb8',
|
|
|
'response_type' => 'array'
|
|
|
];
|
|
|
- $app = Factory::officialAccount($config);
|
|
|
- $app->template_message->send([
|
|
|
- 'touser' => $open_id,
|
|
|
+ $app = Factory::officialAccount($config);
|
|
|
+ $user = $app->user->get('oVxTzvgYlGktIDZXwfLMLQ01Tr5sss');
|
|
|
+ if(!isset($user['openid'])) return true;
|
|
|
+ $app->template_message->send([
|
|
|
+ 'touser' => 'oVxTzvgYlGktIDZXwfLMLQ01Tr5s',
|
|
|
'template_id' => '3LUhWGlyiljxrT3Jh8orwQZ2LSHjfRs9SIHaB40O6q0',
|
|
|
- 'url' => 'http://47.94.228.245',
|
|
|
- 'miniprogram' => [
|
|
|
- 'appid' => 'wx1c2357232cd25f65',
|
|
|
- 'pagepath' => 'pages/index/index',
|
|
|
- ],
|
|
|
+ // 'url' => 'https://t5.9026.com',
|
|
|
'data' => [
|
|
|
'first'=>'社区通知',
|
|
|
- 'key1' => $cotent,
|
|
|
- 'key2' => 18719141830,
|
|
|
- 'key3' => '开发工程师',
|
|
|
- 'key4' => '思维定制',
|
|
|
- 'key5' => '2020-12-12',
|
|
|
+ 'keyword1' => '王海军',
|
|
|
+ 'keyword2' => 18719141830,
|
|
|
+ 'keyword3' => '开发工程师',
|
|
|
+ 'keyword4' => '思维定制',
|
|
|
+ 'keyword5' => '2020-12-12',
|
|
|
],
|
|
|
]);
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
|