Job list currency

This commit is contained in:
CHIEFSOFT\ameye
2023-06-27 15:01:53 -04:00
parent 008ec7cd0c
commit 3bac00b6a0
2 changed files with 24 additions and 4 deletions
+22 -2
View File
@@ -171,6 +171,7 @@ return 0;
}
long WrenchJobManagerList( CVars in, CVars &out){
logfmt(logINFO, "ENTER CALL long WrenchJobManagerList");
char vname[30];
@@ -187,8 +188,11 @@ long WrenchJobManagerList( CVars in, CVars &out){
res = pgsql_query("SELECT id FROM members_jobs WHERE member_id = %lu AND status=1 ORDER BY id DESC", in["member_id"].Long());
out["total_record"] = pgsql_num_rows(res);
res = pgsql_query("SELECT id AS job_id, * FROM members_jobs WHERE member_id = %lu AND status=1 "
"ORDER BY id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset);
res = pgsql_query("SELECT j.id AS job_id, j.*,c.code AS currency_code, c.description AS currency_description "
" FROM members_jobs j "
" WHERE j.member_id = %lu AND j.status=1 "
" LEFT JOIN currency c ON c.country=j.country "
" ORDER BY j.id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset);
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
@@ -223,6 +227,15 @@ long WrenchJobManagerList( CVars in, CVars &out){
snprintf(vname, sizeof (vname), "country_%05d", i);
out[vname] = rec["country"];
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"];
snprintf(vname, sizeof (vname), "job_uid_%05d", i);
out[vname] = rec["uid"];
}
@@ -230,6 +243,13 @@ long WrenchJobManagerList( CVars in, CVars &out){
ret = PHP_API_OK;
out["status"] = "OK";
/*
'job_country' => $out["job_country_${key}"],
'currency' => 'Naira',
'currency_code' => 'NGN',
c.description AS currency_description
wrenchboard=> \d members_jobs
Table "public.members_jobs"
Column | Type | Collation | Nullable | Default
+2 -2
View File
@@ -402,8 +402,8 @@ class ResultFormatter extends Model
'isActive' => true,
'offer_added' => $out["offer_added_${key}"],
'job_country' => $out["job_country_${key}"],
'currency' => 'Naira',
'currency_code' => 'NGN',
'currency' => $out["currency_${key}"],
'currency_code' => $out["currency_code_${key}"],
'interest_count' => $out["${$int_c}"] ?? 0,
'category' => $this->dummyGetCategory()
);