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
+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(){