From 518de5ac7dfeedcdf37152bea874c07aa13e05c1 Mon Sep 17 00:00:00 2001 From: Thabo Date: Mon, 15 Jun 2015 10:33:29 -0700 Subject: [PATCH] add copilot status to user profile --- actions/memberStatistics.js | 3 ++- queries/get_user_basic_profile_basic | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/actions/memberStatistics.js b/actions/memberStatistics.js index 003b92c66..528a7c09d 100644 --- a/actions/memberStatistics.js +++ b/actions/memberStatistics.js @@ -223,7 +223,8 @@ function getBasicUserProfile(api, handle, privateInfoEligibility, dbConnectionMa country: basic.country, memberSince: basic.member_since, quote: basic.quote, - photoLink: basic.photo_link || '' + photoLink: basic.photo_link || '', + copilot: basic.copilot || false }; if (loadData.earnings && _.isDefined(basic.show_earnings) && basic.show_earnings !== 'hide') { diff --git a/queries/get_user_basic_profile_basic b/queries/get_user_basic_profile_basic index 5b55d609a..941e5e0c5 100644 --- a/queries/get_user_basic_profile_basic +++ b/queries/get_user_basic_profile_basic @@ -5,8 +5,10 @@ SELECT , co.quote , p.path || i.file_name AS photo_link , up.value AS show_earnings +, (copilot_profile_id IS NOT NULL) as copilot FROM user u , coder co +, OUTER copilot_profile cp , OUTER country c , OUTER(coder_image_xref cix , image i @@ -23,3 +25,5 @@ AND i.image_type_id = 1 AND i.path_id = p.path_id AND u.user_id = up.user_id AND up.preference_id = 100 +AND u.user_id = cp.user_id +AND cp.copilot_profile_status_id = 1 \ No newline at end of file