From 86d1c1cb6944ccc81cba2b432958c4e50f544baa Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 27 Jun 2023 15:24:01 -0400 Subject: [PATCH] Job country currenies --- wrenchboard/src/shared_tool/jobs.cc | 12 ++++++++++-- www-api/app/Models/ResultFormatter.php | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/wrenchboard/src/shared_tool/jobs.cc b/wrenchboard/src/shared_tool/jobs.cc index 68c0e80d..294a0805 100644 --- a/wrenchboard/src/shared_tool/jobs.cc +++ b/wrenchboard/src/shared_tool/jobs.cc @@ -279,11 +279,13 @@ long WrenchUserJobsInterestList(CVars in, CVars &out) { const PGresult *res = pgsql_query("SELECT mm.id AS client_id, mm.uid AS client_uid, " " mm.firstname AS client_name, m.offer_code, m.uid AS offer_uid, " " mo.member_id, mm.added::date AS client_added, 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.price AS job_price,mo.uid AS interest_uid " + " j.title,j.description,m.job_id,to_char( m.expire, 'Dy Mon dd, yyyy HH:MI AM') AS expire,j.price AS job_price,mo.uid AS interest_uid, " + " c.code AS currency_code, c.description AS currency_description,j.country " " FROM members_offer_interest mo " " 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 mm ON mm.id = mo.member_id " + " LEFT JOIN currency c ON c.country=j.country " " WHERE m.status = 1 AND m.client_id=0 " " AND m.expire IS NOT NULL AND m.expire> now() " " AND mo.member_id = %lu ORDER BY mo.added DESC LIMIT %lu OFFSET %lu",member_id, limit, offset); @@ -331,7 +333,6 @@ long WrenchUserJobsInterestList(CVars in, CVars &out) { snprintf(vname, sizeof (vname), "client_ratings_%05d", i); out[vname] = "0"; - snprintf(vname, sizeof (vname), "offer_code_%05d", i); out[vname] = rec["offer_code"]; @@ -355,6 +356,13 @@ long WrenchUserJobsInterestList(CVars in, CVars &out) { snprintf(vname, sizeof (vname), "price_%05d", i); out[vname] = rec["job_price"]; + + 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"]; } } diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index a99d9eab..efa4cf52 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -115,8 +115,9 @@ class ResultFormatter extends Model "job_id" => $out["job_id_${key}"], "expire" => $out["expire_${key}"], "price" => $out["price_${key}"], - 'currency' => 'Naira', - 'currency_code' => 'NGN', + 'job_country' => $out["job_country_${key}"], + 'currency' => $out["currency_${key}"], + 'currency_code' => $out["currency_code_${key}"], ); }