MemberSms.php 908 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. *
  7. * 站点配置 Table<ai_config_web>
  8. */
  9. namespace app\common\model;
  10. use think\Model;
  11. use filter\Filter;
  12. class MemberSms extends Model
  13. {
  14. protected $pk = 'id';
  15. /**
  16. * 增加
  17. * @param integer $miniapp_id
  18. * @param string $sms
  19. * @return void
  20. */
  21. public static function Sms(int $miniapp_id,$sms,$url = ''){
  22. $data['member_miniapp_id'] = $miniapp_id;
  23. $data['message'] = trim(Filter::filter_escape($sms));
  24. $data['url'] = trim(Filter::filter_escape($url));
  25. $data['create_time'] = time();
  26. $data['is_new'] = 0;
  27. $data['is_read'] = 0;
  28. return self::insert($data);
  29. }
  30. }