Forráskód Böngészése

Merge branch 'master' of http://git.bjzxtw.org.cn:3000/zxt/news_producer

LiuJ 1 napja
szülő
commit
aeff99533d
1 módosított fájl, 6 hozzáadás és 4 törlés
  1. 6 4
      app/JsonRpc/NewsService.php

+ 6 - 4
app/JsonRpc/NewsService.php

@@ -5548,14 +5548,18 @@ class NewsService implements NewsServiceInterface
         'category.name as category_name',
         'category.id as category_id',
         'website_category.aLIas_pinyin as pinyin',
+        'parent_wc.aLIas_pinyin as parent_pinyin',
         DB::raw('100 as type')
       ])
       ->join('category', 'article.catid', '=', 'category.id')
       ->leftJoin('website_category', 'website_category.category_id', '=', 'category.id')
+      ->leftJoin('website_category as parent_wc', function ($join) {
+        $join->on('parent_wc.category_id', '=', 'website_category.pid')
+          ->where('parent_wc.website_id', '=', DB::raw('website_category.website_id'));
+      })
       ->where('website_category.website_id', $data['website_id'])
       ->where('article.status', 1)
       ->whereIn('category.id', $categoryIds)
-      // ->whereRaw('article.created_at >= DATE_SUB(NOW(), INTERVAL 30 DAY)')
       ->orderBy('article.created_at', 'desc')
       ->get()
       ->groupBy('category_id')
@@ -5576,13 +5580,11 @@ class NewsService implements NewsServiceInterface
           'category_name' => $group->first()->category_name,
           'catid' => $group->first()->category_id,
           'pinyin' => $group->first()->pinyin,
-          //                  'type' => 100,
+          'parent_pinyin' => $group->first()->parent_pinyin,
           'list' => $group->take(4)->map(function ($item) {
             return [
               'id' => $item->id,
               'title' => $item->title,
-              //                          'imgurl' => $item->imgurl,
-              //                          'created_at' => $item->created_at
             ];
           })->values()
         ];