解决lists标签中,加上where后其他条件失效的问题
添加时间:2023-03-14 10:10:41
{pc:content action="lists" catid="$catid" where="posids`!='0'" thumb="1" num="10"}
if(isset($data['where'])) {$sql = $data['where'];} else {$thumb = intval($data['thumb']) ? " AND thumb != ''" : '';if($this->category[$catid]['child']) {$catids_str = $this->category[$catid]['arrchildid'];$pos = strpos($catids_str,',')+1;$catids_str = substr($catids_str, $pos);$sql = "status=99 AND catid IN ($catids_str)".$thumb;} else {$sql = "status=99 AND catid='$catid'".$thumb;}}
/*以下为创想工作室修改开始*/if(isset($data['where'])) {$where = (isset($data['where'])&&(!empty($data['where'])))?' AND '.$data['where']:'';$thumb = intval($data['thumb']) ? " AND thumb != ''" : '';if($this->category[$catid]['child']) {$catids_str = $this->category[$catid]['arrchildid'];$pos = strpos($catids_str,',')+1;$catids_str = substr($catids_str, $pos);$sql = "status=99".$where." AND catid IN ($catids_str)".$thumb;} else {$sql = "status=99".$where." AND catid='$catid'".$thumb;}} else {$thumb = intval($data['thumb']) ? " AND thumb != ''" : '';if($this->category[$catid]['child']) {$catids_str = $this->category[$catid]['arrchildid'];$pos = strpos($catids_str,',')+1;$catids_str = substr($catids_str, $pos);$sql = "status=99 AND catid IN ($catids_str)".$thumb;} else {$sql = "status=99 AND catid='$catid'".$thumb;}}