ORDERBY(\ DB ::生( 'ケースavatar_id = 0その後、他0 1'末端))
ドクター::(参加' ユーザー'、' doctors.user_id '、' = '、' users.id ' ) - >(と' ユーザー' ) - > withCount(' サービス'、' ノートブック' ) - > orderByDesc(" notebooks_count ' ) - > orderByDesc(' services_count ' ) - > [並べ替え(\ DB ::生('avatar_id次いで0そう1つの端ヌルである場合' )) - > (' ステータス'、1);