From 09231686f4e404fab90000ca69435da9d1ec73b5 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 10 Feb 2024 09:25:25 -0500 Subject: [PATCH] DAsh detect --- wrenchboard/src/shared_tool/account.cc | 31 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/wrenchboard/src/shared_tool/account.cc b/wrenchboard/src/shared_tool/account.cc index 4581b4e0..23c5e3fb 100644 --- a/wrenchboard/src/shared_tool/account.cc +++ b/wrenchboard/src/shared_tool/account.cc @@ -2504,29 +2504,48 @@ FAMILY_ACTION_SEND_REWARD logfmt(logINFO, "LoginWrenchBoardSetDashType()"); try { REQ_LONG(in, "member_id", 1, -1); - if ( load_db_record(out, "SELECT count(id) AS pending_job_count FROM members_jobs_offer WHERE expire > now() AND member_id = %lu", in["member_id"].Long()) > 0 ){ + // Job Owner Side *********************************************************************************************** + if ( load_db_record(out, "SELECT count(id) AS pending_job_count FROM members_jobs_offer " + " WHERE expire > now() AND member_id = %lu", in["member_id"].Long()) > 0 ){ if ( out["pending_job_count"] > 0 ){ out["home_dash_type"] = "JOBOWNER_HOME_DASH"; return 0; } } - if ( load_db_record(out, "SELECT count(id) AS contract_job_count FROM members_jobs_contract WHERE member_id = %lu AND status IN (1,2,3,4)", in["member_id"].Long()) > 0 ){ + if ( load_db_record(out, "SELECT count(id) AS contract_job_count FROM members_jobs_contract " + " WHERE member_id = %lu AND status IN (1,2,3,4)", in["member_id"].Long()) > 0 ){ if ( out["contract_job_count"] > 0 ){ out["home_dash_type"] = "JOBOWNER_HOME_DASH"; return 0; } } + // Performing member ******************************************************************************************** + if ( load_db_record(out, "SELECT count(id) AS pending_job_count FROM members_jobs_offer " + " WHERE expire > now() AND client_id = %lu", in["member_id"].Long()) > 0 ){ + if ( out["pending_job_count"] > 0 ){ + out["home_dash_type"] = "WORKER_HOME_DASH"; + return 0; + } + } + if ( load_db_record(out, "SELECT count(id) AS contract_job_count FROM members_jobs_contract " + " WHERE client_id = %lu AND status IN (1,2,3,4)", in["member_id"].Long()) > 0 ){ + if ( out["contract_job_count"] > 0 ){ + out["home_dash_type"] = "WORKER_HOME_DASH"; + return 0; + } + } - - - if ( load_db_record(out, "SELECT last_login, country, uid, added, (now() - added::date) AS age_days FROM members WHERE id = %lu", in["member_id"].Long() ) > 0 ){ + // Now the family side ******************************************************************************************* + if ( load_db_record(out, "SELECT last_login, country, uid, added, (now() - added::date) AS age_days " + " FROM members WHERE id = %lu", in["member_id"].Long() ) > 0 ){ if ( out["country"] == "US" ){ out["home_dash_type"] = "FAMILY_PARENT_DASH"; out["family_action"] = "FAMILY_ACTION_NO_KIDS"; - if ( load_db_record(out, "SELECT count(id) AS family_count FROM members_family WHERE member_id = %lu", in["member_id"].Long() ) > 0 ){ + if ( load_db_record(out, "SELECT count(id) AS family_count " + " FROM members_family WHERE member_id = %lu", in["member_id"].Long() ) > 0 ){ if (out["family_count"].Long() > 0 ){ out["family_action"] = "FAMILY_ACTION_SEND_REWARD"; }