fix percent

This commit is contained in:
CHIEFSOFT\ameye
2024-07-20 13:40:11 -04:00
parent 43524c2ccb
commit b6bc1aa564
2 changed files with 16 additions and 7 deletions
+15 -6
View File
@@ -507,12 +507,19 @@ long WrenchUserJobsInterestList(CVars in, CVars &out) {
long WrenchJobsInterestStats(CVars in, CVars &out) {
long ret = PHP_API_BAD_PARAM;
char vname[30];
float pcnt = 0;
//out = in;
float x = 0.61;
char buf[10];
sprintf(buf, "Test=%.2f", x);
printf(buf);
try {
out["job_completed"] = "0";
out["job_active"] = "0";
out["job_percent_complete"] = "0";
out["job_percent_complete"] = "0.0 %";
out["job_uncompleted"] = "0";
out["job_rejected"] = "0";
out["job_pending"] = "0";
@@ -526,12 +533,14 @@ try {
load_db_record(out, "SELECT count(id) AS job_pending FROM members_jobs_offer WHERE client_id = %lu AND expire > now()", out["client_id"].Long()); //pending jobs
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 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 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 total_jobs FROM members_jobs_contract WHERE client_id = %lu AND ststus IN (7,4,5)", out["client_id"].Long()); //pendi
sprintf(buf, "%.2f %", 100* out["total_complete"].Long() / out["total_jobs"].Long());
out["job_percent_complete"] = buf;
}
}
// SELECT id as client_id FROM members WHERE uid::text = 'dfc9d601-780f-4d78-839f-422f0928f911';
+1 -1
View File
@@ -109,7 +109,7 @@ $routes->post('/en/wrench/api/v1/familywallet', 'WrenchWal
$routes->post('/en/wrench/api/v1/familyresources', 'WrenchResources::familyresources');
$routes->post('/en/wrench/api/v1/commonmedia', 'WrenchResources::commonmedia');
$routes->post('/en/wrench/api/v1/familybanners', 'WrenchFamily::familyBanners');
$routes->post('/en/wrench/api/v1/familybanners', 'WrenchFamily::familyBanners');
$routes->post('/en/wrench/api/v1/familysampletasks', 'WrenchFamily::familySampleTasks');