列表500错误
$total = count($productdata->GetProductCount(0,"adddate desc",false,$where));
function GetProductCount($cid,$orderby="adddate desc",$all=false,$where=null){
global $yiqi_db;
$categorydata = new Category();
//where
if($where){
$andwhere = ' AND ' . $where;
$wherewhere = ' where ' . $where;
}
$exist = $categorydata->ExistCategory($cid);
if($exist == 1)
{
$cids = array($cid);
$cids = array_merge($cids,$categorydata->GetSubCategoryIDs($cid));
$cids = implode(',', $cids);
if($all)
{
return $yiqi_db->get_row(CheckSql("select count(*) as n from yiqi_product where cid in ($cids) $andwhere order by $orderby "));
}
else
{
return $yiqi_db->get_row(CheckSql("select count(*) as n from yiqi_product where cid in ($cids) and adddate <= '".date("Y-m-d H:i:s")."' $andwhere order by $orderby "));
}
}
else
{
if($all)
{
return $yiqi_db->get_row(CheckSql("select count(*) as n from yiqi_product $wherewhere order by $orderby"));
}
else
{
return $yiqi_db->get_row(CheckSql("select count(*) as n from yiqi_product where adddate <= '".date("Y-m-d H:i:s")."' $andwhere order by $orderby"));
}
}
}
评论