Categoery

This commit is contained in:
CHIEFSOFT\ameye
2023-06-27 18:08:34 -04:00
parent 359541c1a2
commit e278146c4a
3 changed files with 32 additions and 21 deletions
+5 -1
View File
@@ -434,7 +434,7 @@ long WrenchReturnJobList(CVars in, CVars &out) {
res = pgsql_query("SELECT j.title,j.description,m.id AS job_id,m.expire,m.job_description,j.price, "
" m.offer_code,j.timeline_days, to_char(m.expire, 'Dy Mon dd, yyyy HH:MI AM') AS expire2,"
" m.uid AS offer_uid,j.uid AS job_uid,m.added::date AS offer_added,j.country AS job_country, "
" c.code AS currency_code, c.description AS currency_description,j.country "
" c.code AS currency_code, c.description AS currency_description,j.country, j.category "
" FROM members_jobs_offer m "
" LEFT JOIN members_jobs j ON j.id=m.job_id "
" LEFT JOIN currency c ON c.country=j.country "
@@ -494,6 +494,10 @@ long WrenchReturnJobList(CVars in, CVars &out) {
snprintf(vname, sizeof (vname), "currency_code_%05d", i);
out[vname] = rec["currency_code"];
snprintf(vname, sizeof (vname), "category_%05d", i);
out[vname] = rec["category"];
}
}
/*
@@ -247,6 +247,8 @@ long WrenchJobManagerList( CVars in, CVars &out){
snprintf(vname, sizeof (vname), "currency_code_%05d", i);
out[vname] = rec["currency_code"];
snprintf(vname, sizeof (vname), "category_%05d", i);
out[vname] = rec["category"];
snprintf(vname, sizeof (vname), "job_uid_%05d", i);
out[vname] = rec["uid"];
+25 -20
View File
@@ -332,6 +332,7 @@ class ResultFormatter extends Model
for ($i = 0; $i < $total; $i++) {
$key = sprintf("%05d", $i);
$int_c = 'interest_count_'.$out["offer_code_${key}"];
$cateG = $out["category_${key}"];
$res["result_list"][] = array(
"title" => $out["title_${key}"],
"description" => $out["description_${key}"],
@@ -353,7 +354,7 @@ class ResultFormatter extends Model
'currency' => $out["currency_${key}"],
'currency_code' => $out["currency_code_${key}"],
'interest_count' => $out["${$int_c}"] ?? 0,
'category' => $this->dummyGetCategory()
'category' => $this->dummyGetCategory( $cateG )
);
}
@@ -376,6 +377,7 @@ class ResultFormatter extends Model
for ($i = 0; $i < $total; $i++) {
$key = sprintf("%05d", $i);
$int_c = 'interest_count_'.$out["offer_code_${key}"];
$cateG = $out["category_${key}"];
$res["result_list"][] = array(
"title" => $out["title_${key}"],
"description" => $out["description_${key}"],
@@ -406,7 +408,7 @@ class ResultFormatter extends Model
'currency' => $out["currency_${key}"],
'currency_code' => $out["currency_code_${key}"],
'interest_count' => $out["${$int_c}"] ?? 0,
'category' => $this->dummyGetCategory()
'category' => $this->dummyGetCategory( $cateG )
);
}
@@ -602,24 +604,27 @@ class ResultFormatter extends Model
return $res;
}
public function dummyGetCategory(){
$i= rand(1,4);
$res=array();
switch ($i) {
case 1:
$res= array('CT1', 'CT2');
break;
case 2:
$res= array( 'CT3', 'CT4');
break;
case 3:
$res= array('CT1', 'CT4',);
break;
case 4:
$res= array( 'CT4');
break;
}
return $res;
public function dummyGetCategory($varCat){
return explode("@", $varCat);
// $i= rand(1,4);
// $res=array();
// switch ($i) {
// case 1:
// $res= array('CT1', 'CT2');
// break;
// case 2:
// $res= array( 'CT3', 'CT4');
// break;
// case 3:
// $res= array('CT1', 'CT4',);
// break;
// case 4:
// $res= array( 'CT4');
// break;
// }
// return $res;
}
public function dummyCategory(){