/*--------------------------
//取消審核文檔
function checkArchives1() { }
---------------------------*/
else if($dopost=="checkArchives1")
{
CheckPurview('a_Check,a_AccCheck,sys_ArcBatch');
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
if( !empty($aid) && empty($qstr) )
{
$qstr = $aid;
}
if($qstr=='')
{
ShowMsg("參數(shù)無效!",$ENV_GOBACK_URL);
exit();
}
$arcids = ereg_replace('[^0-9,]','',ereg_replace('`',',',$qstr));
$query = "Select arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable From `dede_arctiny` arc
left join `dede_arctype` tp on tp.id=arc.typeid
left join `dede_channeltype` ch on ch.id=tp.channeltype
where arc.id in($arcids) ";
$dsql->SetQuery($query);
$dsql->Execute('ckall');
while($row = $dsql->GetArray('ckall'))
{
$aid = $row['id'];
//print_r($row);
$maintable = ( trim($row['maintable'])=='' ? 'dede_archives' : trim($row['maintable']) );
$dsql->ExecuteNoneQuery("Update `dede_arctiny` set arcrank='-1' where id='$aid' ");
if($row['issystem']==-1)
{
$dsql->ExecuteNoneQuery("Update `".trim($row['addtable'])."` set arcrank='-1' where aid='$aid' ");
}
else
{
$dsql->ExecuteNoneQuery("Update `$maintable` set arcrank='-1' where id='$aid' ");
}
$pageurl = MakeArt($aid,false);
}
ShowMsg("成功審核指定的文檔!",$ENV_GOBACK_URL);
exit();
}
|