我的数据库有与多个城市相关的类别表。在类别表中,城市列具有逗号分隔的 ID,例如 1、2、3。当我从类别表中检索数据时,我希望城市列包含相应的城市名称而不是城市 ID。
$categoryDetails = $this->Category->find('first',array('conditions'=>array('slug'=> $slug)));
Array
(
[Category] => Array
(
[id] => 10
[parent_id] => 2
[city] => 2, 3, 4, 5, 6, 7, 8, 9, 10
[slug] => college
[type] =>
[lft] => 31
[rght] => 32
[name] => College
[description] => College
[image_name] => 1376938860_1185824_431052847008731_328184125_n.jpg
[created] => 1376938860
[modified] => 1376938860
)
)