DAsh detect
This commit is contained in:
@@ -2504,29 +2504,48 @@ FAMILY_ACTION_SEND_REWARD
|
|||||||
logfmt(logINFO, "LoginWrenchBoardSetDashType()");
|
logfmt(logINFO, "LoginWrenchBoardSetDashType()");
|
||||||
try {
|
try {
|
||||||
REQ_LONG(in, "member_id", 1, -1);
|
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 ){
|
if ( out["pending_job_count"] > 0 ){
|
||||||
out["home_dash_type"] = "JOBOWNER_HOME_DASH";
|
out["home_dash_type"] = "JOBOWNER_HOME_DASH";
|
||||||
return 0;
|
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 ){
|
if ( out["contract_job_count"] > 0 ){
|
||||||
out["home_dash_type"] = "JOBOWNER_HOME_DASH";
|
out["home_dash_type"] = "JOBOWNER_HOME_DASH";
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now the family side *******************************************************************************************
|
||||||
|
if ( load_db_record(out, "SELECT last_login, country, uid, added, (now() - added::date) AS age_days "
|
||||||
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 ){
|
" FROM members WHERE id = %lu", in["member_id"].Long() ) > 0 ){
|
||||||
if ( out["country"] == "US" ){
|
if ( out["country"] == "US" ){
|
||||||
out["home_dash_type"] = "FAMILY_PARENT_DASH";
|
out["home_dash_type"] = "FAMILY_PARENT_DASH";
|
||||||
out["family_action"] = "FAMILY_ACTION_NO_KIDS";
|
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 ){
|
if (out["family_count"].Long() > 0 ){
|
||||||
out["family_action"] = "FAMILY_ACTION_SEND_REWARD";
|
out["family_action"] = "FAMILY_ACTION_SEND_REWARD";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user