thinkphp 关联查询 3张一对多的表 咋弄
1个回答
展开全部
array(2) {
[0] => array(4) {
["Hotel_Id"] => string(1) "4"
["Hotel_Name"] => string(24) "重庆南方君临酒店"
["Hotel_Stars"] => string(1) "1"
["hotelroomlist"] => array(3) {
[0] => array(3) {
["Room_id"] => string(1) "1"
["Room_Name"] => string(12) "豪华大房"
["Room_Bed"] => string(6) "大床"
}
[1] => array(3) {
["Room_id"] => string(1) "2"
["Room_Name"] => string(15) "豪华双人间"
["Room_Bed"] => string(6) "双床"
}
[2] => array(3) {
["Room_id"] => string(1) "5"
["Room_Name"] => string(9) "商务房"
["Room_Bed"] => string(6) "大床"
}
}
}
[1] => array(4) {
["Hotel_Id"] => string(1) "5"
["Hotel_Name"] => string(30) "重庆申基索菲特大酒店"
["Hotel_Stars"] => string(1) "1"
["hotelroomlist"] => array(2) {
[0] => array(3) {
["Room_id"] => string(1) "3"
["Room_Name"] => string(15) "豪华双人房"
["Room_Bed"] => string(12) "双人大床"
}
[1] => array(3) {
["Room_id"] => string(1) "4"
["Room_Name"] => string(12) "商务大房"
["Room_Bed"] => string(6) "大床"
}
}
}
}
这样写行吗?你可以参考一下
[0] => array(4) {
["Hotel_Id"] => string(1) "4"
["Hotel_Name"] => string(24) "重庆南方君临酒店"
["Hotel_Stars"] => string(1) "1"
["hotelroomlist"] => array(3) {
[0] => array(3) {
["Room_id"] => string(1) "1"
["Room_Name"] => string(12) "豪华大房"
["Room_Bed"] => string(6) "大床"
}
[1] => array(3) {
["Room_id"] => string(1) "2"
["Room_Name"] => string(15) "豪华双人间"
["Room_Bed"] => string(6) "双床"
}
[2] => array(3) {
["Room_id"] => string(1) "5"
["Room_Name"] => string(9) "商务房"
["Room_Bed"] => string(6) "大床"
}
}
}
[1] => array(4) {
["Hotel_Id"] => string(1) "5"
["Hotel_Name"] => string(30) "重庆申基索菲特大酒店"
["Hotel_Stars"] => string(1) "1"
["hotelroomlist"] => array(2) {
[0] => array(3) {
["Room_id"] => string(1) "3"
["Room_Name"] => string(15) "豪华双人房"
["Room_Bed"] => string(12) "双人大床"
}
[1] => array(3) {
["Room_id"] => string(1) "4"
["Room_Name"] => string(12) "商务大房"
["Room_Bed"] => string(6) "大床"
}
}
}
}
这样写行吗?你可以参考一下
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询