帝国CMS借助宝塔计划任务定时审核文章,代码如下: [ol]load('fun');$enews=RepPostVar($_POST['enews']);if($enews=="audittiming"){//定时审核$notcheck = $api->load('db')->query('select id,newstime from [!db.pre!]ecms_article_check order by newstime asc');$currtime = time(); // 获取当前时间戳$check = [];if ($notcheck) { foreach ($notcheck as $i => $v) { if ($v['newstime'] load('table')->setChecked('article', $v['id'], 1); $article = $api->load('table')->get('article', $v['id']); GetHtml($article['classid'], $article['id'], $article, 1, 0); $cr=$empire->fetch1("select classid,addinfofen from {$dbtbpre}enewsclass where classid='$article[classid]'"); $fen=$cr['addinfofen']; $sql=$empire->query("update {$dbtbpre}enewsmember set userfen=userfen+$fen where userid='$article[userid]'"); } else { $check[$i]['ischecked'] = 0; $check[$i]['id'] = $v['id']; $check[$i]['newstime'] = date('Y-m-d H:i:s', $v['newstime']); } } $fun->json(1, $check, '操作成功');} else { $fun->json(0, '暂无待审核数据');}}[/ol]复制代码 帝国, 定时
" 除了缓存外可以多看看workerman的吗?能给任意CMS与框架加速的!新版的5.0更强大了,支持Fiber协程,支持Swoole协程,支持Swow协程 image.png (44.88 KB, 下载次数: 0) 下载附件 保存到相册 14分钟前 上传