Просмотр исходного кода

Merge pull request #2302 from visuddhinanda/development

Development
visuddhinanda 10 месяцев назад
Родитель
Сommit
7debdfd5e2

+ 4 - 2
api-v8/app/Services/ProgressChapterService.php

@@ -41,22 +41,24 @@ class ProgressChapterService
     }
     public function get()
     {
+        $tagCount = count($this->tags);
         $chapters = ProgressChapter::where('progress', '>', $this->minProgress)
             ->whereHas('channel', function ($query) {
                 $query->where('owner_uid', $this->channelOwnerId);
             })->whereHas('tags', function ($query) {
                 $query->whereIn('name', $this->tags);
-            })->get();
+            }, '=', $tagCount)->get();
         return $chapters;
     }
     public function getTags()
     {
+        $tagCount = count($this->tags);
         $chapters = ProgressChapter::where('progress', '>', $this->minProgress)
             ->whereHas('channel', function ($query) {
                 $query->where('owner_uid', $this->channelOwnerId);
             })->whereHas('tags', function ($query) {
                 $query->whereIn('name', $this->tags);
-            })->select('uid')->get();
+            }, '=', $tagCount)->select('uid')->get();
         $tagMaps = TagMap::with('tags')->whereIn('anchor_id', $chapters)
             ->get();
         $tags = [];

+ 4 - 2
api-v8/resources/views/blog/category.blade.php

@@ -20,8 +20,10 @@
             <section class="widget tagCloud">
                 <div class="tagCloud-tags">
                     @foreach($tagOptions as $id => $tag)
-                    <a href="{{ $tag['tag']->name }}">{{ $tag['tag']->name }}</a>
-                    @endforeach
+                    @if($tag['count'] < $count)
+                        <a href="{{ rtrim(url()->current(), '/') . '/' . $tag['tag']->name }}">{{ $tag['tag']->name }}({{ $tag['count'] }})</a>
+                        @endif
+                        @endforeach
                 </div>
             </section>
         </div>

+ 1 - 1
api-v8/resources/views/blog/layouts/app.blade.php

@@ -85,7 +85,7 @@
                 <figure class="site-avatar">
                     <a href="https://demo.stack.jimmycai.com/">
                         <img
-                            src="{{ $user['avatar'] }}"
+                            src="{{ $user['avatar'] ?? '' }}"
                             width="300"
                             height="300"
                             class="site-logo"