moonsflyer 4 miesięcy temu
rodzic
commit
a6c07f11bf
1 zmienionych plików z 11 dodań i 7 usunięć
  1. 11 7
      app/common/service/ThemeService.php

+ 11 - 7
app/common/service/ThemeService.php

@@ -67,11 +67,12 @@ class ThemeService
         $userId         = self::$params['user_id'] ?? '';
 
         $moduleList = array_column($content,'name');
-        return $moduleList;
+        outFileLog($moduleList,'moduledata','$moduleList');
         foreach ($moduleList as $moduleKey => $moduleName) {
-
+            outFileLog($moduleName,'moduledata','$moduleName');
             //需要拼接数据的组件
             switch ($moduleName) {
+
                 //商品组件
                 case ThemePageEnum::GOODS:
                     $goods_type = $content[$moduleKey]['content']['goods_type'] ?? 2;
@@ -108,7 +109,7 @@ class ThemeService
                         ->order('sort desc')
                         ->select()
                         ->toArray();
-
+                    outFileLog($goodsList,'moduledata','$moduleName-GOODS');
 //                    foreach($goodsList as &$gv){
 //                        $goods_item_count = GoodsItem::where(['goods_id'=>$gv['id']])->count();
 //                        if($goods_item_count > 1){
@@ -165,7 +166,7 @@ class ThemeService
                             ->limit($limit)
                             ->select()
                             ->toArray();
-
+                        outFileLog($goodsList,'moduledata','$moduleName-TABS');
 //                        foreach($goodsList as &$gv){
 //                            $goods_item_count = GoodsItem::where(['goods_id'=>$gv['id']])->count();
 //                            if($goods_item_count > 1){
@@ -239,7 +240,7 @@ class ThemeService
 
                         $list[]  = $coupon->toArray();
                     }
-
+                    outFileLog($list,'moduledata','$moduleName-COUPON');
                     $content[$moduleKey]['content']['data'] = $list;
                     break;
                 //公告组件
@@ -252,6 +253,7 @@ class ThemeService
                                 ->select()
                                 ->toArray();
                     $content[$moduleKey]['content']['data'] = $noticeList;
+                    outFileLog($noticeList,'moduledata','$moduleName-NOTICE');
                     break;
                 //会员中心-我的服务组件、微页面-导航组件
                 case ThemePageEnum::USERSERVE:
@@ -310,7 +312,7 @@ class ThemeService
                         ->orderRaw($orderField)
                         ->select()
                         ->toArray();
-
+                    outFileLog($goodsList,'moduledata','$moduleName-SPELLGROUP');
                     if(empty($goodsList)){
                         $content[$moduleKey]['content']['data'] = [];
                         break;
@@ -392,6 +394,7 @@ class ThemeService
                         $content[$moduleKey]['content']['data'] = [];
                         break;
                     }
+                    outFileLog($goodsList,'moduledata','$moduleName-SECKILL');
 //                    foreach($goodsList as &$gv){
 //                        $goods_item_count = GoodsItem::where(['goods_id'=>$gv['id']])->count();
 //                        if($goods_item_count > 1){
@@ -477,7 +480,7 @@ class ThemeService
                         ->select()
                         ->toArray();
                     $data = [];
-                    
+                    outFileLog($goodsList,'moduledata','$moduleName-PRESELL');
                     foreach ($lists as $presell) {
                         $data[] = [
                             'id'                => $presell['goods_id'],
@@ -502,6 +505,7 @@ class ThemeService
                     if('admin' == $source || 0 == $show){
                         break;
                     }
+                    outFileLog($show,'moduledata','$moduleName-GOODSRECOM');
                     $content[$moduleKey]['content']['data'] = self::recommend();
                     break;
                 //小程序直播