1 Star 0 Fork 2

acmr/china-hxzb-2017-1-25

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
updatestatus.php 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
2839543 提交于 2017-12-28 22:42 . 2017-12-28 正常发送维护版本
<?php
//针对到期的推送方式制0,判断到期的状态制为0
require 'common.inc.php';
//群发消息到期提示,正式环境上开启注释
$result=$db->query("select openid,itemid from {$DT_PRE}weixin_user WHERE pushstatus=3 and endtime<=".time());
$a=0;
while($r=$db->fetch_array($result)) {
$openid=$r['openid'];
$word="您的微信及邮件提醒服务已结束,继续使用请联系客服".$DT['telephone'];
$type='text';
require DT_ROOT.'/api/weixin/init.inc.php';
$arr = $wx->send($openid, $type, $word);
$post = array();
$post['content'] = $word;
$post['type'] = 'reply';
$post['openid'] = $openid;
$post['editor'] = $_username;
$post['addtime'] = $DT_TIME;
$post['misc']['type'] = $type;
$post['misc'] = $post['misc'] ? serialize($post['misc']) : '';
$post = daddslashes($post);
$sql = '';
foreach($post as $k=>$v) {
$sql .= ",$k='$v'";
}
$time=time();
$db->query("UPDATE {$DT_PRE}weixin_user SET pushwx='0',pushemail='0',pushstatus='2',endtime=".$time." WHERE itemid=".$r['itemid']);
$db->query("INSERT INTO {$DT_PRE}weixin_chat SET ".substr($sql, 1));
$a++;
}
$b=0;
$result1=$db->query("select itemid,email from {$DT_PRE}email_user WHERE pushstatus=3 and endtime<=".time());
while($r1=$db->fetch_array($result1)) {
$db->query("UPDATE {$DT_PRE}email_user SET pushemail='0',pushstatus='2',endtime=".$time." WHERE itemid=".$r1['itemid']);
$b++;
}
echo "此次更新微信订阅".$a."条,邮箱推送".$b."条";
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/acmr/china-hxzb-2017-1-25.git
git@gitee.com:acmr/china-hxzb-2017-1-25.git
acmr
china-hxzb-2017-1-25
china-hxzb-2017-1-25
master

搜索帮助