$sql="select a.id,a.area\_title,a.area\_type,a.max\_limit,
(select GROUP\_CONCAT(d.device\_name) from kc\_device as d where FIND\_IN\_SET(d.id,a.device\_id)) as device\_name,
(select GROUP\_CONCAT(dep.dep\_name) from kc\_department as dep where FIND\_IN\_SET(dep.id,a.dep\_id)) as dep\_name
from kc\_area as a";
$list=Db::query($sql);
结果如下
![](https://img.kancloud.cn/6f/32/6f3298dfc20f0bd9839b01faaf0cd5a9_1720x251.png)