业绩代码查询实战——php
一、一级代码显示职员
foreach($data_职员信息 as $key => $value){
//$where_查询分类=$where_查询通用;
//$dat分类one = $业绩提成->where($where_查询分类)->order("CreateDate desc")->select();
if($value['haschildname']==0 && $value['key'] !="cyberwinsum"){
$where_查询分类=$where_查询通用;
$where_查询分类[$value['key']]=$value['value'];
//var_dump($where_查询分类);
//->order("CreateDate desc")
// $dat分类one = $业绩提成->where($where_查询分类)->field("count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj")->find();
//$dat分类onelist = $业绩提成->where($where_查询分类)->group("EmpCode,EmpName")->field("EmpCode,EmpName,count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj")->select();
//EmpCode
$dat分类onelist = $业绩提成->where($where_查询分类)->field("count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj")->find();
$data_职员信息[$key]['childdata']=$dat分类onelist;
echo "<hr>";
echo "<br>数据";
//var_dump($dat分类onelist);
echo "<hr>";
//echo $业绩提成->getLastSQL();
echo "<hr>";
}
if($value['haschildname']==1 && $value['key'] !="cyberwinsum"){
}
}
二、进阶
多层嵌套
foreach($data_职员信息 as $key职员 => $value职员){
//$where_查询分类=$where_查询通用;
//$dat分类one = $业绩提成->where($where_查询分类)->order("CreateDate desc")->select();
$data_职员信息_统计one =array();
$data_职员信息_统计one = $混合统计;
foreach($混合统计 as $key头 => $value头){
if($value头['haschildname']==0 && $value头['key'] !="cyberwinsum"){
$where_查询分类职员=$where_查询通用;
$where_查询分类职员[$value头['key']]=$value头['value'];
$where_查询分类职员[$value头['EmpCode']]=$value职员['EmpCode'];
//var_dump($where_查询分类);
//->order("CreateDate desc")
// $dat分类one = $业绩提成->where($where_查询分类)->field("count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj")->find();
//$dat分类onelist = $业绩提成->where($where_查询分类)->group("EmpCode,EmpName")->field("EmpCode,EmpName,count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj")->select();
//EmpCode
$dat分类职员onelist = $业绩提成->where($where_查询分类职员)->field("count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj")->find();
$data_职员信息_统计one[$key头]['childdata_all']=$dat分类职员onelist;
echo "<hr>";
echo "<br>数据";
//var_dump($dat分类onelist);
echo "<hr>";
//echo $业绩提成->getLastSQL();
echo "<hr>";
}
if($value头['haschildname']==1 && $value头['key'] !="cyberwinsum"){
}
}
$data_职员信息[$key职员]['childdata_hor']=$data_职员信息_统计one;
}