如何在联接表中没有结果的情况下获得结果,但仅限于该用户?
例如:
$availableQuests = Upload::where('uploads.approved', 1)
->where('uploads.published', 1)
->where('uploads.available', 1)
->where('uploads.type', 'guide')
->join('completed_guides', 'uploads.id', '=', 'completed_guides.upload_id')
->whereNull('completed_guides.id')
->orderBy('published_at', 'desc')
->take(10)
->get();
这个问题,这解释了所有用户,我需要以某种方式包含completed_guides.user_id
来获取completed_guides
如果这有道理?