Categoery
This commit is contained in:
@@ -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, "
|
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.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, "
|
" 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 "
|
" FROM members_jobs_offer m "
|
||||||
" 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 "
|
" 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);
|
snprintf(vname, sizeof (vname), "currency_code_%05d", i);
|
||||||
out[vname] = rec["currency_code"];
|
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);
|
snprintf(vname, sizeof (vname), "currency_code_%05d", i);
|
||||||
out[vname] = rec["currency_code"];
|
out[vname] = rec["currency_code"];
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "category_%05d", i);
|
||||||
|
out[vname] = rec["category"];
|
||||||
|
|
||||||
snprintf(vname, sizeof (vname), "job_uid_%05d", i);
|
snprintf(vname, sizeof (vname), "job_uid_%05d", i);
|
||||||
out[vname] = rec["uid"];
|
out[vname] = rec["uid"];
|
||||||
|
|||||||
@@ -332,6 +332,7 @@ class ResultFormatter extends Model
|
|||||||
for ($i = 0; $i < $total; $i++) {
|
for ($i = 0; $i < $total; $i++) {
|
||||||
$key = sprintf("%05d", $i);
|
$key = sprintf("%05d", $i);
|
||||||
$int_c = 'interest_count_'.$out["offer_code_${key}"];
|
$int_c = 'interest_count_'.$out["offer_code_${key}"];
|
||||||
|
$cateG = $out["category_${key}"];
|
||||||
$res["result_list"][] = array(
|
$res["result_list"][] = array(
|
||||||
"title" => $out["title_${key}"],
|
"title" => $out["title_${key}"],
|
||||||
"description" => $out["description_${key}"],
|
"description" => $out["description_${key}"],
|
||||||
@@ -353,7 +354,7 @@ class ResultFormatter extends Model
|
|||||||
'currency' => $out["currency_${key}"],
|
'currency' => $out["currency_${key}"],
|
||||||
'currency_code' => $out["currency_code_${key}"],
|
'currency_code' => $out["currency_code_${key}"],
|
||||||
'interest_count' => $out["${$int_c}"] ?? 0,
|
'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++) {
|
for ($i = 0; $i < $total; $i++) {
|
||||||
$key = sprintf("%05d", $i);
|
$key = sprintf("%05d", $i);
|
||||||
$int_c = 'interest_count_'.$out["offer_code_${key}"];
|
$int_c = 'interest_count_'.$out["offer_code_${key}"];
|
||||||
|
$cateG = $out["category_${key}"];
|
||||||
$res["result_list"][] = array(
|
$res["result_list"][] = array(
|
||||||
"title" => $out["title_${key}"],
|
"title" => $out["title_${key}"],
|
||||||
"description" => $out["description_${key}"],
|
"description" => $out["description_${key}"],
|
||||||
@@ -406,7 +408,7 @@ class ResultFormatter extends Model
|
|||||||
'currency' => $out["currency_${key}"],
|
'currency' => $out["currency_${key}"],
|
||||||
'currency_code' => $out["currency_code_${key}"],
|
'currency_code' => $out["currency_code_${key}"],
|
||||||
'interest_count' => $out["${$int_c}"] ?? 0,
|
'interest_count' => $out["${$int_c}"] ?? 0,
|
||||||
'category' => $this->dummyGetCategory()
|
'category' => $this->dummyGetCategory( $cateG )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,24 +604,27 @@ class ResultFormatter extends Model
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dummyGetCategory(){
|
public function dummyGetCategory($varCat){
|
||||||
$i= rand(1,4);
|
|
||||||
$res=array();
|
return explode("@", $varCat);
|
||||||
switch ($i) {
|
|
||||||
case 1:
|
// $i= rand(1,4);
|
||||||
$res= array('CT1', 'CT2');
|
// $res=array();
|
||||||
break;
|
// switch ($i) {
|
||||||
case 2:
|
// case 1:
|
||||||
$res= array( 'CT3', 'CT4');
|
// $res= array('CT1', 'CT2');
|
||||||
break;
|
// break;
|
||||||
case 3:
|
// case 2:
|
||||||
$res= array('CT1', 'CT4',);
|
// $res= array( 'CT3', 'CT4');
|
||||||
break;
|
// break;
|
||||||
case 4:
|
// case 3:
|
||||||
$res= array( 'CT4');
|
// $res= array('CT1', 'CT4',);
|
||||||
break;
|
// break;
|
||||||
}
|
// case 4:
|
||||||
return $res;
|
// $res= array( 'CT4');
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// return $res;
|
||||||
}
|
}
|
||||||
public function dummyCategory(){
|
public function dummyCategory(){
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user