> 백엔드 개발 > PHP 튜토리얼 > CI框架里用pChart作报表数组不好识别

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

WBOY
풀어 주다: 2016-06-13 13:18:04
원래의
920명이 탐색했습니다.

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_salesman_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

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿