Categoery
This commit is contained in:
@@ -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(){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user