您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

CI里数组转换有关问题

2025/10/21 12:58:59发布10次查看
ci里数组转换问题
查询数组 
$str2=from crm_ltsz_customer_info_def;
if($_post[employeeid]!= && $_post[employeeid]!=null)
{
$str3= bl_salesman_id=.$_post[employeeid]. and;
};
$array1[0]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='01');
  $array1[1]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='02');
  $array1[2]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='03');
  $array1[3]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='04');
  $array1[4]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='05');
  $array1[5]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='06');
  $array1[6]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='07');
  $array1[7]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='08');
  $array1[8]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='09');
  $array1[9]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='10');
  $array1[10]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='11');
  $array1[11]= $this->db->query('select count(customer_id) as `count` '.$str2.' where '.$str3. year(create_time)=.$_post[createtime]. and month(create_time)='12');
$result = array();
  foreach ( $array1 as $v ) {
$result[] = $v->row_array();
  }
  print_r($result);
  exit();
出的结果是
 array
(
  [0] => array
  (
  [count] => 0
  )
[1] => array
  (
  [count] => 1
  )
[2] => array
  (
  [count] => 0
  )
[3] => array
  (
  [count] => 0
  )
[4] => array
  (
  [count] => 1
  )
[5] => array
  (
  [count] => 0
  )
[6] => array
  (
  [count] => 1
  )
[7] => array
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product