Jobs completed

This commit is contained in:
CHIEFSOFT\ameye
2024-07-20 18:18:38 -04:00
parent 32695ce0e7
commit c5ee7778f6
+4 -4
View File
@@ -532,13 +532,13 @@ long WrenchJobsInterestStats(CVars in, CVars &out) {
load_db_record(out, "SELECT count(id) job_active FROM members_jobs_contract WHERE client_id = %lu AND delivery_date> now() AND status = 1", out["client_id"].Long()); //job_active
load_db_record(out, "SELECT delivery_date::date AS job_last_date FROM members_jobs_contract WHERE client_id = %lu AND status =7 ORDER BY delivery_date DESC LIMIT 1", out["client_id"].Long()); //job_active
load_db_record(out, "SELECT count(id) AS total_complete FROM members_jobs_contract WHERE client_id = %lu AND status =7", out["client_id"].Long()); //pending jobs
if ( out["total_complete"].Long() > 0 ){
load_db_record(out, "SELECT count(id) AS job_completed FROM members_jobs_contract WHERE client_id = %lu AND status =7", out["client_id"].Long()); //pending jobs
if ( out["job_completed"].Long() > 0 ){
load_db_record(out, "SELECT count(id) AS total_jobs FROM members_jobs_contract WHERE client_id = %lu AND status IN (7,4,5)", out["client_id"].Long()); //pendi
logfmt(logINFO, "~~~~~~~~~~~~~ *********** DIR ******************** %d", 100* out["total_complete"].Long() / out["total_jobs"].Long());
logfmt(logINFO, "~~~~~~~~~~~~~ *********** DIR ******************** %d", 100* out["job_completed"].Long() / out["total_jobs"].Long());
sprintf(buf, "%d %", 100* out["total_complete"].Long() / out["total_jobs"].Long());
sprintf(buf, "%d %", 100* out["job_completed"].Long() / out["total_jobs"].Long());
logfmt(logINFO, "~~~~~~~~~~~~~ *********** Buf ******************** %s", buf);