• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

CI框架里用pChart作报表数组不好识别

php 搞代码 3年前 (2022-01-24) 12次浏览 已收录 0个评论

CI框架里用pChart做报表数组不好识别
这是查询的代码
$array1[0]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’01′”);
$array1[1]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’02′”);
$array1[2]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’03′”);
$array1[3]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’04′”);
$array1[4]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’05′”);
$array1[5]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’06′”);
$array1[6]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’07′”);
$array1[7]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’08′”);
$array1[8]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’09′”);
$array1[9]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’10′”);
$array1[10]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesm(本文来源gaodai#ma#com搞@@代~&码网

搞代gaodaima码

an_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’11′”);
$array1[11]= $this->db->query(‘select count(customer_id) ‘.$str2.’ where bl_salesman_id=’.$_POST[“EmployeeId”].” and year(create_time)=’2012′ and month(create_time)=’12′”);

$result = array();

foreach ( $array1 as $v ) {
$result[] = $v->row_array();

}

print_r($result);
exit();
$_SESSION =$v;

结果是:
Array
(
[0] => Array
(
[count(customer_id)] => 4
)

[1] => Array
(
[count(customer_id)] => 1
)

[2] => Array
(
[count(customer_id)] => 1
)

[3] => Array
(
[count(customer_id)] => 2
)

[4] => Array
(
[count(customer_id)] => 2
)

[5] => Array
(
[count(customer_id)] => 1
)

[6] => Array
(
[count(customer_id)] => 1
)

[7] => Array
(
[count(customer_id)] => 3
)

[8] => Array
(
[count(customer_id)] => 2


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:CI框架里用pChart作报表数组不好识别

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址