Using Pchart as a report array in CI framework is not well recognized
Last Update:2016-06-13
Source: Internet
Author: User
Using Pchart to make report array in CI frame bad recognition
This is the code for the query
$array 1[0]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 01 '");
$array 1[1]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 02 '");
$array 1[2]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 03 '");
$array 1[3]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 04 '");
$array 1[4]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 05 '");
$array 1[5]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 06 '");
$array 1[6]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 07 '");
$array 1[7]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 08 '");
$array 1[8]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 09 '");
$array 1[9]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId"] . "And year (create_time) = ' + ' and month (create_time) = ' 10 '");
$array 1[10]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId" ]. "And year (create_time) = ' + ' and month (create_time) = ' 11 '");
$array 1[11]= $this->db->query (' Select count (customer_id) '. $str 2. ' Where bl_salesman_id= '. $_post["EmployeeId" ]. "And year (create_time) = ' + ' and month (create_time) = ' 12 '");
$result = Array ();
foreach ($array 1 as $v) {
$result [] = $v->row_array ();
}
Print_r ($result);
Exit ();
$_session = $v;
The result is:
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