标签:cas when users doc case not vat books erb
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);
标签:cas when users doc case not vat books erb
原文地址:https://www.cnblogs.com/fenle/p/11613899.html