moonsflyer 5 luni în urmă
părinte
comite
cff36601b7
1 a modificat fișierele cu 14 adăugiri și 1 ștergeri
  1. 14 1
      app/shopapi/lists/InfoLists.php

+ 14 - 1
app/shopapi/lists/InfoLists.php

@@ -23,6 +23,7 @@ use app\common\enum\AccountLogEnum;
 use app\common\lists\ListsSearchInterface;
 use app\common\model\Article;
 use app\common\model\Info;
+use app\common\model\InfoCategory;
 use app\common\model\Banner;
 
 class InfoLists extends BaseShopDataLists
@@ -77,7 +78,19 @@ class InfoLists extends BaseShopDataLists
                         }
                     }
                 }
-                $lists = $newlist;
+                $data=[];
+                $i = 0;
+
+                foreach($newlist as $k=>$nv){
+                    $category_info = InfoCategory::find($k);
+
+                    $data[$i]['categoryId'] = $k;
+                    $data[$i]['categoryName'] = $category_info['name'];
+                    $data[$i]['list'] = $nv;
+                    $i++;
+                }
+
+                $lists = $data;
             }
         }