从以下查询获得预期结果:
com.google.firebase.firestore.FirebaseFirestoreException: Failed to get document because the client is offline.
如何在(Eloquent或在查询生成器中)以laravel方式进行查询
注意: 涉及以下表格:
间
ID
数
命名
设施
ID
名称
amenities_room
ROOM_ID
amenities_id
答案 0 :(得分:0)
response.json())
计算相关模型的文档:https://laravel.com/docs/5.5/eloquent-relationships#counting-related-models
答案 1 :(得分:0)
您收到此错误mb_strpos() expects parameter 1 to be string, object given
,因为您的雄辩期待一个字符串,但您已在withCount()
传递了一个对象,请尝试此
$rooms = Room::with('amenities')
->withCount('amenities')->where(function($query){
$query->whereIn('id', [2, 3]);
})
->where('amenities_count', 2)
->get()