修改步骤:
一:结合项调用函数声明处加上:,$emod_r,$class_r,$empire,$dbtbpre; 引入公共变量
二:增加统计方法代码
以下为用到的代码:
折叠PHP 代码
- //修改开始
- $andval=$vtr[1];
- $total=0;
- $mclassid=$classid;
- if(!is_numeric($classid)){
- $classid = explode(',', $classid);
- $classidArr=array();
- foreach ($classid as $key1 => $val1) {
- $intclassid = (int)$val1;
- if($intclassid){
- array_push($classidArr,$intclassid);
- }
- }
- $mclassid=$classidArr[0];
- $classid = join(',',$classidArr);
- }
- $mid = $class_r[$mclassid][modid];
- $tbname = $class_r[$mclassid][tbname];
- if(!emptyempty($andval))
- {
- $andval=RepPostVar2($andval);
- if(strstr($andval,'__'))
- {
- $andbtr=explode('__',$andval);
- $andbtr[0]=(float)$andbtr[0];
- $andbtr[1]=(float)$andbtr[1];
- if($andbtr[0]&&$andbtr[1])
- {
- $listandf=$field." BETWEEN '".$andbtr[0]."' and '".$andbtr[1]."'";
- }
- }
- elseif(emptyempty($emod_r[$mid]['setandf']))
- {
- $listandf=$field."='".$andval."'";
- }
- else
- {
- $listandf=$field." like '%".$andval."%'";
- }
- $val = $vtr[1];
- $total=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_{$tbname} where classid in ($classid) and $listandf");
- }else{
- $total=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_{$tbname} where classid in ($classid)");
- }
- //修改结束
最终效果如下:
Tags: 结合项