if (!($nums = $db->result_one("SELECT COUNT(*) FROM {$tblprefix}gurls {$wheresql}"))) { amessage('nogatheritem'); } $pages = @ceil($nums / $atpp); $npage = $fromid = 0; } $npage = empty($npage) ? 0 : $npage; $c_upload = new cls_upload(); $gather = new cls_gather(); $gather->set_mission($gsid); $gather->gather_fields(); //先行分析采集规则 empty($gather->fields) && amessage(lang('p_setrule')); $query = $db->query("SELECT guid FROM {$tblprefix}gurls {$wheresql} AND guid>'{$fromid}' ORDER BY guid ASC LIMIT 0,{$atpp}"); while ($row = $db->fetch_array($query)) { $gather->gather_guid($row['guid'], 0); $fromid = $row['guid']; } unset($gather); $npage++; if ($npage <= $pages) { amessage('operating', "?entry=gmissions&action=allauto&gsid={$gsid}&deal=gather&pages={$pages}&npage={$npage}&fromid={$fromid}&confirm=1&use_push=1{$param_suffix}", $pages, $npage + 1, "<a href=\"?entry=gmissions&action=gmissionsedit{$param_suffix}\">", '</a>'); } $progress->hide(); amessage('toautoouput', "?entry=gmissions&action=allauto&gsid={$gsid}&deal=output&confirm=1&use_push=1{$param_suffix}"); } elseif ($deal == 'output') { $progress->hide(); //已入库但未完结的合辑中的子内容也需要入库 $wheresql = "WHERE gsid='{$gsid}' AND gatherdate<>'0' AND " . ($gmission['sonid'] ? 'abover=0' : 'outputdate=0'); if (empty($pages)) { if (!($nums = $db->result_one("SELECT COUNT(*) FROM {$tblprefix}gurls {$wheresql}"))) {
function gather_sonid($pid = 0, $gsid = 0) { //采集合辑中的未采集项目 global $db, $tblprefix, $timestamp, $sid; if (!$pid || !$gsid) { return; } $ng = new cls_gather(); $ng->set_mission($gsid); $ng->gather_fields(); //先行分析采集规则 if (empty($ng->fields)) { return; } $query = $db->query("SELECT guid FROM {$tblprefix}gurls WHERE gsid='{$gsid}' AND gatherdate='0' AND pid='{$pid}' ORDER BY guid ASC"); while ($row = $db->fetch_array($query)) { $ng->gather_guid($row['guid'], 0); } unset($ng); }