Hard coded currency removed

This commit is contained in:
CHIEFSOFT\ameye
2023-06-27 15:14:09 -04:00
parent 3bac00b6a0
commit 4614f79ff3
3 changed files with 19 additions and 8 deletions
+16 -5
View File
@@ -916,10 +916,12 @@ long WrenchReturnPendingJobList(CVars in, CVars &out) {
res = pgsql_query("SELECT mo.member_id, to_char(mo.added, 'Dy Mon dd, yyyy HH:MI AM') AS sent," res = pgsql_query("SELECT mo.member_id, to_char(mo.added, 'Dy Mon dd, yyyy HH:MI AM') AS sent,"
" j.title,j.description,m.job_id,to_char( m.expire, 'Dy Mon dd, yyyy HH:MI AM') AS expire " " j.title,j.description,m.job_id,to_char( m.expire, 'Dy Mon dd, yyyy HH:MI AM') AS expire, "
" c.code AS currency_code, c.description AS currency_description,j.country "
" FROM members_offer_interest mo " " FROM members_offer_interest mo "
" LEFT JOIN members_jobs_offer m ON m.id = mo.offer_id " " LEFT JOIN members_jobs_offer m ON m.id = mo.offer_id "
" LEFT JOIN members_jobs j ON j.id=m.job_id " " LEFT JOIN members_jobs j ON j.id=m.job_id "
" LEFT JOIN currency c ON c.country=j.country "
" WHERE m.status = 1 AND m.client_id=0 " " WHERE m.status = 1 AND m.client_id=0 "
" AND m.expire IS NOT NULL AND m.expire> now() AND m.public_view = 1 " " AND m.expire IS NOT NULL AND m.expire> now() AND m.public_view = 1 "
" AND mo.member_id = %lu ORDER BY mo.added DESC LIMIT %lu", in["member_id"].Long(), in["limit"].Long()); " AND mo.member_id = %lu ORDER BY mo.added DESC LIMIT %lu", in["member_id"].Long(), in["limit"].Long());
@@ -942,12 +944,21 @@ long WrenchReturnPendingJobList(CVars in, CVars &out) {
snprintf(vname, sizeof (vname), "id_%05d", i); snprintf(vname, sizeof (vname), "id_%05d", i);
out[vname] = rec["job_id"]; out[vname] = rec["job_id"];
snprintf(vname, sizeof (vname), "expire_%05d", i); snprintf(vname, sizeof (vname), "expire_%05d", i);
out[vname] = rec["expire"]; out[vname] = rec["expire"];
snprintf(vname, sizeof (vname), "sent_%05d", i); snprintf(vname, sizeof (vname), "sent_%05d", i);
out[vname] = rec["sent"]; out[vname] = rec["sent"];
snprintf(vname, sizeof (vname), "job_country_%05d", i);
out[vname] = rec["country"];
snprintf(vname, sizeof (vname), "currency_%05d", i);
out[vname] = rec["currency_description"];
snprintf(vname, sizeof (vname), "currency_code_%05d", i);
out[vname] = rec["currency_code"];
} }
} }
+1 -1
View File
@@ -190,8 +190,8 @@ long WrenchJobManagerList( CVars in, CVars &out){
res = pgsql_query("SELECT j.id AS job_id, j.*,c.code AS currency_code, c.description AS currency_description " res = pgsql_query("SELECT j.id AS job_id, j.*,c.code AS currency_code, c.description AS currency_description "
" FROM members_jobs j " " FROM members_jobs j "
" WHERE j.member_id = %lu AND j.status=1 "
" LEFT JOIN currency c ON c.country=j.country " " LEFT JOIN currency c ON c.country=j.country "
" WHERE j.member_id = %lu AND j.status=1 "
" ORDER BY j.id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset); " ORDER BY j.id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset);
if (res != NULL && pgsql_num_rows(res) > 0) { if (res != NULL && pgsql_num_rows(res) > 0) {
+2 -2
View File
@@ -349,8 +349,8 @@ class ResultFormatter extends Model
'isActive' => true, 'isActive' => true,
'offer_added' => $out["offer_added_${key}"], 'offer_added' => $out["offer_added_${key}"],
'job_country' => $out["job_country_${key}"], 'job_country' => $out["job_country_${key}"],
'currency' => 'Naira', 'currency' => $out["currency_${key}"],
'currency_code' => 'NGN', 'currency_code' => $out["currency_code_${key}"],
'interest_count' => $out["${$int_c}"] ?? 0, 'interest_count' => $out["${$int_c}"] ?? 0,
'category' => $this->dummyGetCategory() 'category' => $this->dummyGetCategory()
); );