NoticeService.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\service\api\notice;
  12. use app\model\sys\SysNotice;
  13. use core\base\BaseApiService;
  14. /**
  15. * 登录服务层
  16. * Class BaseService
  17. * @package app\service
  18. */
  19. class NoticeService extends BaseApiService
  20. {
  21. public function __construct()
  22. {
  23. parent::__construct();
  24. }
  25. /**
  26. * 发送消息
  27. * @param $key
  28. * @param $data
  29. * @return bool
  30. */
  31. public function send($key, $data)
  32. {
  33. return ( new \app\service\core\notice\NoticeService() )->send($key, $data);
  34. }
  35. /**
  36. * 获取微信小程序订阅消息模板id
  37. * @param string $keys
  38. * @return array
  39. */
  40. public function getWeappNoticeTemplateId(string $keys) {
  41. return (new SysNotice())->where([ ['key', 'in', explode(',', $keys) ], ['weapp_template_id', '<>', ''], ['is_weapp', '=', 1] ])->column('weapp_template_id');
  42. }
  43. }