找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

destoon程序-会员30天到期提醒模板消息实现

[复制链接]
发表于 2020-9-15 23:20:34 | 显示全部楼层 |阅读模式
这类模板消息可以利用系统的计划任务,
定时执行通知如下,是一个会员到期30天的计划任务

在计划任务目录 api/cron 里建一个文件 如:vip通知   viptongzhi.inc.php

文件内容为:

  • <?php
  • defined('IN_DESTOON') or exit('Access Denied');
  • $atime = strtotime(date("Y-m-d"),time())+2592000;
  • $btime = strtotime(date("Y-m-d"),time())+2678400;
  • $result = DB::query("SELECt username,totime FROM ".DT_PRE."company WHERe totime between $atime and $btime");
  • $g7 = cache_read('group-7.php');
  • while($r = DB::fetch_array($result)) {
  •     $todate = date("Y-m-d",$r['totime']);
  •     $par = $arr = array();
  •     $arr['first']['value' = '网站会员服务到期提醒';
  •     $arr['keyword1']['value' = 'VIP会员';
  •     $arr['keyword2']['value' = 'VIP会员服务';
  •     $arr['keyword3']['value' = $todate;
  •     $arr['keyword4']['value' = $g7['fee'].'元/年';
  •     $arr['remark']['value' = '点击“详情”进入网站立即续费';
  •     $par['username' = $r['username'];
  •     $par['template_id' = 'uiUglueraB2bYCaOyufJerPbahh-u5nXKKdqdyDoJmk';
  •     $par['url' = $EXT['mobile_url'];
  •     $par['topcolor' = '#FF0000';
  •     $par['data' = $arr;
  •     echo dcurl(DT_PATH.'/api/weixin/send.php', 'auth='.encrypt(json_encode($par), DT_KEY.'WXTS', 60));
  • }
  • ?>

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|知识在线

GMT+8, 2026-11-2 21:24 , Processed in 0.360790 second(s), 21 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表