@Alimotreb @ali.bayat @khanzadimahdi
چرا از groupbyیراد میگیره
$channel = \App\DetailsModel::groupBy('link')->whereNotNull('name_channel')->take(5)->orderBy(DB::raw('RAND()'))->get();
, ارورش اینه
SQLSTATE[42000]: Syntax error or access violation: 1055 'curl.details.id' isn't in GROUP BY (SQL: select * from `details` where `name_channel` is not null group by `link` order by RAND() asc limit 5) (View: /home/netwons/PhpstormProjects/untitled1/resources/views/index.blade.php) (View: /home/netwons/PhpstormProjects/untitled1/resources/views/index.blade.php)@ali.bayat
این ارور رو میده
Property [name_channel] does not exist on this collection instance. (View:
در صورتی که name_channel موجود هست
شاید پاسخ شما همینجا باشد
@ali.bayat
انجام دادم نشد
@ali.bayat
راه دیگه نداره
سری به پیج زیر در stackoverflow بزن
https://stackoverflow.com/questions/40917189/laravel-syntax-error-or-access-violation-1055-error
@khanzadimahdi @ali.bayat @Alimotreb
این ارور رو میده
SQLSTATE[42000]: Syntax error or access violation: 1055 'curl.details.id' isn't in GROUP BY (SQL: select * from `details` where `name_channel` is not null group by `link` order by RAND() limit 5) (View: /home/netwons/PhpstormProjects/untitled1/resources/views/index.blade.php) (View: /home/netwons/PhpstormProjects/untitled1/resources/views/index.blade.php)@khanzadimahdi
این مشکل من حل نشد
الان درسته اما خالی بودن name_channel اجرا نمیشه
و یک نکته ای من می خوام توی هر name_channel بیاد 5 تا لینک هم چاپ کنه
@khanzadimahdi