linwu 2 vuotta sitten
vanhempi
commit
c43f144ec6

+ 2 - 4
app/Http/Controllers/Web/HomeController.php

@@ -275,14 +275,12 @@ class HomeController extends WebBaseController
         $ad_pic_where2[] = ['r_c_id', '!=', 0];
         $ad_pic_where2[] = ['deleted_at', '=', null];
         $ad_pic_where2[] = ['small_img', '<>', ''];
-        $ad_pic2         = Recuperate::where($ad_pic_where2)->orderBy('list_order', 'asc')->orderBy('id', 'desc')->limit(4)->get();
+        $ad_pic2         = Recuperate::where($ad_pic_where2)->orderBy('list_order', 'desc')->orderBy('id', 'desc')->limit(4)->get();
         //人才疗休养分类
         $Recuperatecategory_arr = RecuperateCategory::where('deleted_at', null)->select('id', 'name')->get()->toArray();
 
         //人才新闻
-        $ad_pic_where3[] = ['type_id', '=', 51];
-        $ad_pic_where3[] = ['small_img', '<>', ''];
-        $ad_pic3         = Article::where($ad_pic_where3)->orderBy('list_order', 'asc')->orderBy('id', 'desc')->limit(4)->get();
+        $ad_pic3         = Article::whereIn('type_id',[58, 59])->orderBy('list_order', 'desc')->orderBy('id', 'desc')->limit(4)->get();
 
         $rcinfos = $this->policyService->getRcInfosByIndex();
 

+ 20 - 25
public/themes/default/views/app/index.blade.php

@@ -421,31 +421,26 @@
                     @endif
                 </div>
                 <div class="home_news_list">
-                    @if(array_has($articles, '3') && $articles['3'])
-                        @foreach($articles['3'] as $k=>$v)
-                            @if($k<4)
-                                <div class="home_news_item">
-                                    <div class="news_time">
-                                        <div class="news_day">{{date('d',strtotime($v->created_at))}}</div>
-                                        <div class="news_year">{{date('Y/m月',strtotime($v->created_at))}}</div>
-                                    </div>
-                                    <div class="news_info">
-                                        @if(empty($v->is_url))
-                                            <a href="{{route('news.show',['id'=>$v->id])}}" target="_blank"
-                                               class="news_title substring" title="{{$v->title}}">{{$v->title}}</a>
-                                            <div class="news_content">{!!  cut_str(strip_tags(htmlspecialchars_decode($v->content,ENT_QUOTES)),'80',0,'...') !!}</div>
-                                        @else
-                                            <a href="{{$v->is_url}}" target="_blank"
-                                               class="news_title substring" title="{{$v->title}}">{{$v->title}}</a>
-                                            <div class="news_content">{!!  cut_str(strip_tags(htmlspecialchars_decode($v->content,ENT_QUOTES)),'80',0,'...') !!}</div>
-                                        @endif
-                                    </div>
-                                    <div class="clear"></div>
-                                </div>
-                            @endif
-
-                        @endforeach
-                    @endif
+                    @foreach($ad_pic3 as $k=>$v)
+                        <div class="home_news_item">
+                            <div class="news_time">
+                                <div class="news_day">{{date('d',strtotime($v->created_at))}}</div>
+                                <div class="news_year">{{date('Y/m月',strtotime($v->created_at))}}</div>
+                            </div>
+                            <div class="news_info">
+                                @if(empty($v->is_url))
+                                    <a href="{{route('news.show',['id'=>$v->id])}}" target="_blank"
+                                       class="news_title substring" title="{{$v->title}}">{{$v->title}}</a>
+                                    <div class="news_content">{!!  cut_str(strip_tags(htmlspecialchars_decode($v->content,ENT_QUOTES)),'80',0,'...') !!}</div>
+                                @else
+                                    <a href="{{$v->is_url}}" target="_blank"
+                                       class="news_title substring" title="{{$v->title}}">{{$v->title}}</a>
+                                    <div class="news_content">{!!  cut_str(strip_tags(htmlspecialchars_decode($v->content,ENT_QUOTES)),'80',0,'...') !!}</div>
+                                @endif
+                            </div>
+                            <div class="clear"></div>
+                        </div>
+                    @endforeach
                 </div>
                 <div class="clear"></div>
                 <a href="{{route('news.list',['id'=>3])}}" class="box_more" target="_blank">查看更多&gt;</a>