控制器部件代码
$Viewcustomer=$this->Viewcustomer->query("SELECT GROUP_CONCAT(usertype_name SEPARATOR ',') as usertypename, customer_name FROM `pre`.`customer` AS `Viewcustomer` WHERE `Viewcustomer`.`customer_status` = 0 AND `Viewcustomer`.`customer_type` = 'B1'
GROUP BY `customer_id` DESC");
$this->set("Viewcustomer",$Viewcustomer);
查看零件代码
foreach($Viewcustomer as $customers){
echo $customers['Viewcustomer']['usertypename'];
}
答案 0 :(得分:0)
usertypename
不应该进入$customers['Viewcustomer']['usertypename'];
这应该是$customers['0']['usertypename'];
请打印您的阵列并分享您的代码