i changed my codes to
$titles = Titles::join('users', 'entries.user_id', '=', 'users.id')
->where('title_id', '0')
->whereIn('entries.user_id', function($query) use ($value)
{
$query->select(DB::raw('CASE WHEN user_id='. $value .' THEN content_id ELSE user_id END AS friendID'))
->from('tasks')
->where('type', 2)
->where('situation', 1)
->where(function ($query) use ($value) {
$query->where('user_id', $value)
->orWhere('content_id', $value);
});
})
->get(['entries.*','users.name']);
return View::make('test_home', compact('titles'));
and now i'm stucked,
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community