orderBy(\DB::Raw('case when avatar_id = 0 then 0 else 1 end'))

Doctor::join('users', 'doctors.user_id', '=', 'users.id')
            ->with('user')
            ->withCount('services', 'notebooks')
            ->orderByDesc('notebooks_count')
            ->orderByDesc('services_count')
            ->orderBy(\DB::Raw('case when avatar_id is null then 0 else 1 end'))
            ->where('status', 1);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-02-14
猜你喜欢
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-01-02
  • 2021-12-15
  • 2021-12-22
  • 2022-02-27
相关资源
相似解决方案