NoticeService.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <?php
  2. namespace App\Services\Share;
  3. use App\Http\Controllers\Miniprogram\Core;
  4. use App\Http\Controllers\Wechat\Kfaccount;
  5. use App\Models\NoticeModel;
  6. use App\Models\PartnerModel;
  7. use App\Models\User\AuthKey;
  8. use App\Models\User\Openid;
  9. use App\Models\User\UserModel;
  10. use App\Services\Log\NoticeLogService;
  11. use App\Services\Notice\ManageService;
  12. use App\Services\NoticeService\Channels\WeChatTemplateChannel;
  13. use App\Services\QQMiniApp\Template;
  14. use App\Services\Service;
  15. class NoticeService extends Service
  16. {
  17. /**
  18. * 解锁进度提升-喜欢我的解锁
  19. * @param $to_uid
  20. * @param $invite_uid
  21. * @param $invite_id
  22. * @return bool
  23. * @throws \Exception
  24. */
  25. public function inviteToLock($to_uid, $invite_uid, $invite_id)
  26. {
  27. $title = "交友卡片-喜欢我的解锁";
  28. $uuid = uuid();
  29. $noticeLog = new NoticeLogService();
  30. try {
  31. $nms = new ManageService();
  32. if (!$nms->getNoticeByKey($to_uid, "fpdx_help_notice")) {
  33. $noticeLog->record($to_uid, $title, "取消订阅", $uuid);
  34. return false;
  35. }
  36. $user = UserModel::find($to_uid);
  37. $invite_user = UserModel::find($invite_uid);
  38. $public_id = config('wechat.fpdx.public_id');
  39. $template_id = '06XYI6xZMauy5D3gP8R7g3J0J_Jq5y7N5ZpcwTvi6mI';
  40. $page = "pages/starter/starter?log_type=notice&log_id={$uuid}&launch_type=free&url=%2Fpages%2Finvite-likeme-unlock%2Finvite-likeme-unlock%3Fpraise_id%3D{$invite_id}";
  41. $data = [
  42. 'first' => [
  43. 'value' => "卡片解锁进度增加啦!\n",
  44. ],
  45. 'keyword1' => [
  46. 'value' => "你的好友{$invite_user->nickname}为你增加了卡片解锁进度",
  47. ],
  48. 'keyword2' => [
  49. 'value' => "\"喜欢我的\"卡片解锁\n",
  50. ],
  51. 'remark' => [
  52. 'value' => "点此查看助力结果-若不想接收此消息,可在“我-通知开关”中关闭",
  53. "color" => "#ff7e98",
  54. ],
  55. ];
  56. $core = new Core();
  57. if ($core->template($user->uid, $template_id, $public_id, $page, $data)) {
  58. $noticeLog->record($to_uid, $title, "公众号模板消息", $uuid, 1, $data);
  59. return true;
  60. }
  61. } catch (\Exception $e) {
  62. app('sentry')->captureException($e);
  63. }
  64. $noticeLog->record($to_uid, $title, "发送失败", $uuid);
  65. return false;
  66. }
  67. /**
  68. * 人气值好友助力-分享者
  69. * @param int $to_uid
  70. * @param array $help
  71. * @return bool
  72. */
  73. public function popularitySharehelp2ShareUser(int $to_uid, array $help)
  74. {
  75. $title = '人气值好友助力通知分享者';
  76. $uuid = uuid();
  77. $noticeLog = new NoticeLogService();
  78. $timelong = 2 + 8 * $help['isnew'];
  79. $helpuser = UserModel::findOrFail($help['help_uid']);
  80. $content = "你的好友@{$helpuser->nickname} 成功为你增加人气值 {$timelong}小时";
  81. // QQ小程序模版消息
  82. $auth = AuthKey::where(array(['auth_type', config("qqprogram.app_id")], ['uid', $to_uid]))->first();
  83. if (!collect($auth)->isEmpty()) {
  84. $page = "popularity/pages/help/help";
  85. $app = new Template(config("qqprogram.app_id"));
  86. $app->setTitle($title)
  87. ->setUuid(uuid())
  88. ->setParameters([
  89. 'keyword1' => [
  90. 'value' => "人气值提升啦!",
  91. ],
  92. 'keyword2' => [
  93. 'value' => $content,
  94. ],
  95. 'keyword3' => [
  96. 'value' => "人气值-增加曝光",
  97. ],
  98. 'keyword4' => [
  99. 'value' => "点此查看我的人气值",
  100. ],
  101. ])
  102. ->setTemplateId("172b97e61188c41c15477a48181ef6c0")
  103. ->toUser($to_uid)
  104. ->setPage($page)
  105. ->send();
  106. }
  107. $page = "pages/starter/starter?log_type=notice&log_id={$uuid}&launch_type=free&url=%2Fpopularity%2Fpages%2Fhelp%2Fhelp";
  108. // 公众号客服消息
  109. $openid = Openid::ofPublic($to_uid)->value('openid');
  110. $kfcontent = "{$content}\n\n<a data-miniprogram-appid='wx4c1722a4055bd229' data-miniprogram-path='{$page}'>查看我的人气值</a>";
  111. $result = Kfaccount::text([
  112. 'touser' => $openid,
  113. 'content' => $kfcontent,
  114. 'kf_account' => 'notice@admin',
  115. ]);
  116. if ($result['code'] == 0) {
  117. $noticeLog->record($to_uid, $title, "公众号客服消息", $uuid, 1, $kfcontent);
  118. return true;
  119. }
  120. // 公众号模板消息
  121. $public_id = config('wechat.fpdx.public_id');
  122. $template_id = "06XYI6xZMauy5D3gP8R7g3J0J_Jq5y7N5ZpcwTvi6mI";
  123. $page = "popularity/pages/help/help";
  124. $parameters = [
  125. 'first' => [
  126. 'value' => "人气值提升啦~\n",
  127. ],
  128. 'keyword1' => [
  129. 'value' => $content . "\n",
  130. ],
  131. 'keyword2' => [
  132. 'value' => "人气值-增加曝光\n",
  133. ],
  134. 'remark' => [
  135. 'value' => "查看我的人气值",
  136. "color" => "#FF7E98",
  137. ],
  138. ];
  139. $app = (new WeChatTemplateChannel())->setAppId($public_id)
  140. ->toUser($to_uid)->setTitle($title)->setPage($page)
  141. ->setParameters($parameters)->setTemplateId($template_id)
  142. ->send();
  143. if (0 == $app->getCode()) {
  144. return true;
  145. }
  146. $public_id = "gh_c94c95866ca5";
  147. $template_id = "V9qPmFurdkeTRqjOCdWLUj8LMsLndAR3UwnWazi6ZfY";
  148. $page = "popularity/pages/help/help";
  149. $parameters = [
  150. 'first' => [
  151. 'value' => "人气值提升啦~\n",
  152. ],
  153. 'keyword1' => [
  154. 'value' => $content . "\n",
  155. ],
  156. 'keyword2' => [
  157. 'value' => "人气值-增加曝光\n",
  158. ],
  159. 'remark' => [
  160. 'value' => "查看我的人气值",
  161. "color" => "#FF7E98",
  162. ],
  163. ];
  164. $app = (new WeChatTemplateChannel())->setAppId($public_id)
  165. ->toUser($to_uid)->setTitle($title)->setPage($page)
  166. ->setParameters($parameters)->setTemplateId($template_id)
  167. ->send();
  168. if (0 == $app->getCode()) {
  169. return true;
  170. }
  171. $noticeLog->record($to_uid, $title, "发送失败", $uuid);
  172. return false;
  173. }
  174. /**
  175. * 人气值好友助力-助力者
  176. * @param int $to_uid
  177. * @param array $help
  178. * @return bool
  179. */
  180. public function popularitySharehelp2HelpUser(int $to_uid, array $help)
  181. {
  182. // 未关注服务号 | 无可上架交友卡片 | 卡片隐身
  183. $partner = PartnerModel::where('uid', $to_uid)->firstOrFail();
  184. if (
  185. isset($partner->is_sell)
  186. && 1 == $partner->is_sell
  187. && Openid::where([['uid', $to_uid], ['subscribe', 1], ['public_id', 'gh_b598cb7474d8']])->exists()
  188. ) {
  189. return false;
  190. }
  191. $title = '人气值好友助力通知助力者';
  192. $uuid = uuid();
  193. $noticeLog = new NoticeLogService();
  194. $timelong = 2 + 8 * $help['isnew'];
  195. $shareuser = UserModel::findOrFail($help['share_uid']);
  196. // QQ小程序模版消息
  197. $auth = AuthKey::where(array(['auth_type', config("qqprogram.app_id")], ['uid', $to_uid]))->first();
  198. if (!collect($auth)->isEmpty()) {
  199. $page = "popularity/pages/score/score";
  200. $app = new Template(config("qqprogram.app_id"));
  201. $app->setTitle($title)
  202. ->setUuid(uuid())
  203. ->setParameters([
  204. 'keyword1' => array(
  205. 'value' => "助力成功",
  206. ),
  207. 'keyword2' => array(
  208. 'value' => "你成功为你的好友@{$shareuser->nickname} 助力",
  209. ),
  210. 'keyword3' => array(
  211. 'value' => "人气值-增加曝光",
  212. ),
  213. 'keyword4' => array(
  214. 'value' => "点此查看我的人气值",
  215. ),
  216. ])
  217. ->setTemplateId("172b97e61188c41c15477a48181ef6c0")
  218. ->toUser($auth->auth_key)
  219. ->setPage($page)
  220. ->send();
  221. }
  222. $public_id = config("wechat.fpdx.public_id");
  223. $template_id = "06XYI6xZMauy5D3gP8R7g3J0J_Jq5y7N5ZpcwTvi6mI";
  224. $page = "popularity/pages/score/score";
  225. $parameters = [
  226. 'first' => [
  227. 'value' => "你成功为你的好友@{$shareuser->nickname} 助力\n",
  228. ],
  229. 'keyword1' => [
  230. 'value' => "助力成功\n",
  231. ],
  232. 'keyword2' => [
  233. 'value' => "人气值-增加曝光\n",
  234. ],
  235. 'remark' => [
  236. 'value' => "点此查看你的人气值",
  237. "color" => "#FF7E98",
  238. ],
  239. ];
  240. $app = (new WeChatTemplateChannel())->setAppId($public_id)
  241. ->toUser($to_uid)->setTitle($title)->setPage($page)
  242. ->setParameters($parameters)->setTemplateId($template_id)
  243. ->send();
  244. if (0 == $app->getCode()) {
  245. // 发送系统消息
  246. NoticeModel::create([
  247. 'type' => 5,
  248. 'uid' => $to_uid,
  249. 'create_at' => time(),
  250. 'title' => "成功助力提醒",
  251. 'content' => "你成功为你的好友@{$shareuser->nickname} 新增人气值{$timelong}小时",
  252. 'tab_content' => '点此了解人气值',
  253. 'tab_url' => '/popularity/pages/score/score',
  254. ]);
  255. return true;
  256. }
  257. $public_id = "gh_c94c95866ca5";
  258. $template_id = "V9qPmFurdkeTRqjOCdWLUj8LMsLndAR3UwnWazi6ZfY";
  259. $page = "popularity/pages/score/score";
  260. $parameters = [
  261. 'first' => [
  262. 'value' => "你成功为你的好友@{$shareuser->nickname} 助力\n",
  263. ],
  264. 'keyword1' => [
  265. 'value' => "助力成功\n",
  266. ],
  267. 'keyword2' => [
  268. 'value' => "人气值-增加曝光\n",
  269. ],
  270. 'remark' => [
  271. 'value' => "点此查看你的人气值",
  272. "color" => "#FF7E98",
  273. ],
  274. ];
  275. $app = (new WeChatTemplateChannel())->setAppId($public_id)
  276. ->toUser($to_uid)->setTitle($title)->setPage($page)
  277. ->setParameters($parameters)->setTemplateId($template_id)
  278. ->send();
  279. if (0 == $app->getCode()) {
  280. // 发送系统消息
  281. NoticeModel::create([
  282. 'type' => 5,
  283. 'uid' => $to_uid,
  284. 'create_at' => time(),
  285. 'title' => "成功助力提醒",
  286. 'content' => "你成功为你的好友@{$shareuser->nickname} 新增人气值{$timelong}小时",
  287. 'tab_content' => '点此了解人气值',
  288. 'tab_url' => '/popularity/pages/score/score',
  289. ]);
  290. return true;
  291. }
  292. // 小程序模板消息
  293. $public_id = config('miniprogram.public_id');
  294. $template_id = "IFUqurIlP88yg1KJDSGI3zAA0oRSRLFaxgeZerTrbe4";
  295. $data = [
  296. 'keyword1' => [
  297. 'value' => "你成功为你的好友@{$shareuser->nickname} 助力\n",
  298. ],
  299. 'keyword2' => [
  300. 'value' => "助力成功\n",
  301. ],
  302. 'keyword3' => [
  303. 'value' => "人气值-增加曝光\n",
  304. ],
  305. 'keyword4' => [
  306. 'value' => "点此查看你的人气值",
  307. ],
  308. ];
  309. $core = new Core();
  310. $result = $core->miniTemplate($to_uid, $template_id, $public_id, $page, $data);
  311. if ($result) {
  312. $noticeLog->record($to_uid, $title, "小程序模板消息", $uuid, 1, $data);
  313. // 发送系统消息
  314. NoticeModel::create([
  315. 'type' => 5,
  316. 'uid' => $to_uid,
  317. 'title' => "成功助力提醒",
  318. 'content' => "你成功为你的好友@{$shareuser->nickname} 新增人气值{$timelong}小时",
  319. 'tab_content' => '点此了解人气值',
  320. 'tab_url' => '/popularity/pages/score/score',
  321. ]);
  322. return true;
  323. }
  324. $noticeLog->record($to_uid, $title, "发送失败", $uuid);
  325. return false;
  326. }
  327. /**
  328. * 人气值助力时间到期提醒
  329. * @param int $to_uid
  330. * @return bool
  331. */
  332. public function popularitySharehelpExpire(int $to_uid)
  333. {
  334. $title = '人气值好友助力时间到期通知';
  335. $uuid = uuid();
  336. $qquuid = uuid();
  337. $noticeLog = new NoticeLogService();
  338. try {
  339. $content = "你新增的人气值将于10分钟后停止加持,到期后将回归原有人气值。维持人气值将获得更多的曝光机会哦。";
  340. // QQ小程序模版消息
  341. $auth = AuthKey::where(array(['auth_type', config("qqprogram.app_id")], ['uid', $to_uid]))->first();
  342. if (!collect($auth)->isEmpty()) {
  343. $page = "popularity/pages/help/help";
  344. $app = new Template(config("qqprogram.app_id"));
  345. $app->setTitle($title)
  346. ->setUuid(uuid())
  347. ->setParameters([
  348. 'keyword1' => array(
  349. 'value' => "人气值变化提醒",
  350. ),
  351. 'keyword2' => array(
  352. 'value' => "助力到期",
  353. ),
  354. 'keyword3' => array(
  355. 'value' => $content,
  356. ),
  357. ])
  358. ->setTemplateId("97888863d45a37a7ef08e5e1aedfbfe1")
  359. ->toUser($auth->auth_key)
  360. ->setPage($page)
  361. ->send();
  362. }
  363. // 公众号客服消息
  364. $openid = Openid::ofPublic($to_uid)->value('openid');
  365. $page = "pages/starter/starter?log_type=notice&log_id={$uuid}&launch_type=free&url=%2Fpopularity%2Fpages%2Fhelp%2Fhelp";
  366. $kfcontent = "{$content}\n\n点击【<a data-miniprogram-appid='wx4c1722a4055bd229' data-miniprogram-path='{$page}'>这里</a>】查看详情";
  367. $result = Kfaccount::text([
  368. 'touser' => $openid,
  369. 'content' => $kfcontent,
  370. 'kf_account' => 'notice@admin',
  371. ]);
  372. if ($result['code'] == 0) {
  373. $noticeLog->record($to_uid, $title, "公众号客服消息", $uuid, 1, $kfcontent);
  374. // 发送系统消息
  375. NoticeModel::create([
  376. 'type' => 5,
  377. 'uid' => $to_uid,
  378. 'title' => "助力新增人气值即将失效",
  379. 'content' => "你新增的人气值将于10分钟后停止加持,到期后将回归原有人气值。维持人气值将获得更多的曝光机会哦。",
  380. 'tab_content' => '查看详情',
  381. 'tab_url' => '/popularity/pages/help/help',
  382. ]);
  383. return true;
  384. }
  385. $public_id = "gh_c94c95866ca5";
  386. // 公众号模板消息
  387. $public_id = config('wechat.fpdx.public_id');
  388. $template_id = "ugxHaIxl5sFf2T00QZdCc0l4qELRUfEtw1HnCE7PDww";
  389. $page = "popularity/pages/help/help";
  390. $parameters = [
  391. 'first' => [
  392. 'value' => $content . "\n",
  393. ],
  394. 'keyword1' => [
  395. 'value' => "助力到期\n",
  396. ],
  397. 'keyword2' => [
  398. 'value' => "增加人气值\n",
  399. ],
  400. 'keyword3' => [
  401. 'value' => "人气值\n",
  402. ],
  403. 'keyword4' => [
  404. 'value' => date('Y年m月d日') . "\n",
  405. ],
  406. 'remark' => [
  407. 'value' => "点此查看详情",
  408. "color" => "#FF7E98",
  409. ],
  410. ];
  411. $app = (new WeChatTemplateChannel())->setAppId($public_id)
  412. ->toUser($to_uid)->setTitle($title)->setPage($page)
  413. ->setParameters($parameters)->setTemplateId($template_id)
  414. ->send();
  415. if (0 == $app->getCode()) {
  416. // 发送系统消息
  417. NoticeModel::create([
  418. 'type' => 5,
  419. 'uid' => $to_uid,
  420. 'title' => "助力新增人气值即将失效",
  421. 'content' => "你新增的人气值将于10分钟后停止加持,到期后将回归原有人气值。维持人气值将获得更多的曝光机会哦。",
  422. 'tab_content' => '查看详情',
  423. 'tab_url' => '/popularity/pages/help/help',
  424. ]);
  425. return true;
  426. }
  427. $public_id = "gh_c94c95866ca5";
  428. $template_id = "HgmFhBPrOry3i647Zu9AF4Vcfs0MaIj8bE83-G5Kg6Q";
  429. $page = "popularity/pages/help/help";
  430. $parameters = [
  431. 'first' => [
  432. 'value' => $content . "\n",
  433. ],
  434. 'keyword1' => [
  435. 'value' => "助力到期\n",
  436. ],
  437. 'keyword2' => [
  438. 'value' => "增加人气值\n",
  439. ],
  440. 'keyword3' => [
  441. 'value' => "人气值\n",
  442. ],
  443. 'keyword4' => [
  444. 'value' => date('Y年m月d日') . "\n",
  445. ],
  446. 'remark' => [
  447. 'value' => "点此查看详情",
  448. "color" => "#FF7E98",
  449. ],
  450. ];
  451. $app = (new WeChatTemplateChannel())->setAppId($public_id)
  452. ->toUser($to_uid)->setTitle($title)->setPage($page)
  453. ->setParameters($parameters)->setTemplateId($template_id)
  454. ->send();
  455. if (0 == $app->getCode()) {
  456. // 发送系统消息
  457. NoticeModel::create([
  458. 'type' => 5,
  459. 'uid' => $to_uid,
  460. 'title' => "助力新增人气值即将失效",
  461. 'content' => "你新增的人气值将于10分钟后停止加持,到期后将回归原有人气值。维持人气值将获得更多的曝光机会哦。",
  462. 'tab_content' => '查看详情',
  463. 'tab_url' => '/popularity/pages/help/help',
  464. ]);
  465. return true;
  466. }
  467. } catch (\Exception $e) {
  468. }
  469. $noticeLog->record($to_uid, $title, "发送失败", $uuid);
  470. return false;
  471. }
  472. /**
  473. * 人气值小花提升时间到期通知
  474. * @param int $to_uid
  475. * @return bool
  476. */
  477. public function popularityFlawerExpire(int $to_uid)
  478. {
  479. $title = '人气值小花提升时间到期通知';
  480. $noticeLog = new NoticeLogService();
  481. $content = "你新增的人气值将于10分钟后停止加持,到期后将回归原有人气值。维持人气值将获得更多的曝光机会哦。";
  482. // QQ小程序模版消息
  483. $auth = AuthKey::where(array(['auth_type', config("qqprogram.app_id")], ['uid', $to_uid]))->first();
  484. if (!collect($auth)->isEmpty()) {
  485. $page = "popularity/pages/score/score";
  486. $app = new Template(config("qqprogram.app_id"));
  487. $app->setTitle($title)
  488. ->setUuid(uuid())
  489. ->setParameters([
  490. 'keyword1' => array(
  491. 'value' => "人气值变化提醒",
  492. ),
  493. 'keyword2' => array(
  494. 'value' => "助力到期",
  495. ),
  496. 'keyword3' => array(
  497. 'value' => $content,
  498. ),
  499. ])
  500. ->setTemplateId("97888863d45a37a7ef08e5e1aedfbfe1")
  501. ->toUser($to_uid)
  502. ->setPage($page)
  503. ->send();
  504. }
  505. $uuid = uuid();
  506. // 公众号客服消息
  507. $openid = Openid::ofPublic($to_uid)->value('openid');
  508. $page = "pages/starter/starter?log_type=notice&log_id={$uuid}&launch_type=free&url=%2Fpopularity%2Fpages%2Fscore%2Fscore";
  509. $kfcontent = "{$content}\n\n点击【<a data-miniprogram-appid='wx4c1722a4055bd229' data-miniprogram-path='{$page}'>这里</a>】查看详情";
  510. $result = Kfaccount::text([
  511. 'touser' => $openid,
  512. 'content' => $kfcontent,
  513. 'kf_account' => 'notice@admin',
  514. ]);
  515. if ($result['code'] == 0) {
  516. $noticeLog->record($to_uid, $title, "公众号客服消息", $uuid, 1, $kfcontent);
  517. // 发送系统消息
  518. NoticeModel::create([
  519. 'type' => 5,
  520. 'uid' => $to_uid,
  521. 'title' => "小fa新增人气值即将失效",
  522. 'content' => "你新增的人气值将于10分钟后停止加持,到期后将回归原有人气值。维持人气值将获得更多的曝光机会哦。",
  523. 'tab_content' => '查看详情',
  524. 'tab_url' => '/popularity/pages/score/score',
  525. ]);
  526. return true;
  527. }
  528. // 公众号模板消息
  529. $public_id = config('wechat.fpdx.public_id');
  530. $template_id = "ugxHaIxl5sFf2T00QZdCc0l4qELRUfEtw1HnCE7PDww";
  531. $data = [
  532. 'first' => [
  533. 'value' => $content . "\n",
  534. ],
  535. 'keyword1' => [
  536. 'value' => "助力到期\n",
  537. ],
  538. 'keyword2' => [
  539. 'value' => "增加人气值\n",
  540. ],
  541. 'keyword3' => [
  542. 'value' => "人气值\n",
  543. ],
  544. 'keyword4' => [
  545. 'value' => date('Y年m月d日') . "\n",
  546. ],
  547. 'remark' => [
  548. 'value' => "点此查看详情",
  549. "color" => "#FF7E98",
  550. ],
  551. ];
  552. $core = new Core();
  553. $result = $core->template($to_uid, $template_id, $public_id, $page, $data);
  554. if ($result) {
  555. $noticeLog->record($to_uid, $title, "公众号模板消息", $uuid, 1, $data);
  556. // 发送系统消息
  557. NoticeModel::create([
  558. 'type' => 5,
  559. 'uid' => $to_uid,
  560. 'title' => "小fa新增人气值即将失效",
  561. 'content' => "你新增的人气值将于10分钟后停止加持,到期后将回归原有人气值。维持人气值将获得更多的曝光机会哦。",
  562. 'tab_content' => '查看详情',
  563. 'tab_url' => '/popularity/pages/score/score',
  564. ]);
  565. return true;
  566. }
  567. $noticeLog->record($to_uid, $title, "发送失败", $uuid);
  568. return false;
  569. }
  570. }