Job owner dash

This commit is contained in:
CHIEFSOFT\ameye
2024-02-10 08:46:52 -05:00
parent 4673420482
commit 85a2017685
+19 -1
View File
@@ -2504,7 +2504,25 @@ FAMILY_ACTION_SEND_REWARD
logfmt(logINFO, "LoginWrenchBoardSetDashType()");
try {
REQ_LONG(in, "member_id", 1, -1);
if ( load_db_record(out, "SELECT last_login, country, uid FROM members WHERE id = %lu", in["member_id"].Long() ) > 0 ){
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 ( out["contract_job_count"] > 0 ){
out["home_dash_type"] = "JOBOWNER_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 ){
if ( out["country"] == "US" ){
out["home_dash_type"] = "FAMILY_PARENT_DASH";
out["family_action"] = "FAMILY_ACTION_NO_KIDS";