foreach ($res['xsumpre'] as $key => $value) {
$fsql="select count(*) from (SELECT sum(sumprem) FROM datatom.fccont where
signdate BETWEEN '$stime' AND '$etime' AND
agentcode in(select agentcode from datatom.shouxian_faagenttree
where agentstate not in('01','02') and OUTWORKDATE between '$stime' AND '$etime')
GROUP BY agentcode having sum(sumprem) <= '$value' ORDER BY sum ) as a";
$fres=$this->pgdb->mpg_select($fsql)['0']['count'];
// var_dump($value,$fres['0']['count']);
$res['tate'][]=round($fres/$zres['0']['count'],4)*100;
}
return $res;
接口慢
返回结果样式
xsumpre 的数量和tate的返回个数要一致
{
"code": 0,
"data": {
"xsumpre": [
1001066,
2002132,
3003198,
4004264,
5005330,
6006396,
7007462,
8008528,
9009594,
10010660
],
"quit": 12.21,
"tate": [
0.46,
0.46,
0.46,
0.46,
0.46,
0.46,
0.46,
0.46,
0.46,
0.46
]
},
"msg": "success"
}
侃侃尔雅