Commit 77128c8b authored by 章建武's avatar 章建武

修改bug

parent 311437c0
...@@ -10,14 +10,12 @@ class ArticleInfoValidate extends Validate ...@@ -10,14 +10,12 @@ class ArticleInfoValidate extends Validate
protected $rule = [ protected $rule = [
'title|标题' => 'require', 'title|标题' => 'require',
'content|内容' => 'require', 'content|内容' => 'require',
'introduce|简介' => 'require',
]; ];
protected $message = [ protected $message = [
'title.require' => '标题不能为空', 'title.require' => '标题不能为空',
'content.require' => '内容不能为空', 'content.require' => '内容不能为空',
'introduce.require' => '简介不能为空',
]; ];
......
...@@ -37,16 +37,15 @@ class ArticleController extends Controller ...@@ -37,16 +37,15 @@ class ArticleController extends Controller
$news_center = ArticleInfo::query() $news_center = ArticleInfo::query()
->where('type', '=', 1) ->where('type', '=', 1)
->where('language_type', '=', $language_type) ->where('language_type', '=', $language_type)
->orderBy('id', 'desc') ->orderBy('num', 'desc')
->first(); ->first();
$news_center2 = ArticleInfo::query() $news_center2 = ArticleInfo::query()
->where('type', '=', 4) ->where('type', '=', 4)
->where('language_type', '=', $language_type) ->where('language_type', '=', $language_type)
->orderBy('id', 'desc') ->orderBy('num', 'desc')
->first(); ->first();
$group_news1 = ArticleInfo::query()->where('type', '=', NewsType::GROUP_NEWS) $group_news1 = ArticleInfo::query()->where('type', '=', NewsType::GROUP_NEWS)
->orderBy('id', 'asc') ->orderBy('num', 'asc')
->where('language_type', '=', $language_type) ->where('language_type', '=', $language_type)
->limit(3)->get(); ->limit(3)->get();
...@@ -55,17 +54,17 @@ class ArticleController extends Controller ...@@ -55,17 +54,17 @@ class ArticleController extends Controller
->where('status', '=', 0) ->where('status', '=', 0)
->where('type', 2) ->where('type', 2)
// ->whereNotIn('id', $group_news1->pluck('id')->toArray()) // ->whereNotIn('id', $group_news1->pluck('id')->toArray())
->orderBy('id', 'asc') ->orderBy('num', 'asc')
->limit(2)->get(); ->limit(2)->get();
// dd($language_type); // dd($language_type);
$item_trends = ArticleInfo::query()->where('type', '=', NewsType::ITEM_TRENDS) $item_trends = ArticleInfo::query()->where('type', '=', NewsType::ITEM_TRENDS)
->where('language_type', '=', $language_type) ->where('language_type', '=', $language_type)
->orderBy('id', 'asc') ->orderBy('num', 'asc')
->limit(2)->get(); ->limit(2)->get();
$item_trends2 = ArticleInfo::query()->where('type', '=', NewsType::ITEM_TRENDS) $item_trends2 = ArticleInfo::query()->where('type', '=', NewsType::ITEM_TRENDS)
->where('language_type', '=', $language_type) ->where('language_type', '=', $language_type)
// ->whereNotIn('id', $item_trends->pluck('id')->toArray()) // ->whereNotIn('id', $item_trends->pluck('id')->toArray())
->orderBy('id', 'asc') ->orderBy('num', 'asc')
->limit(3)->get(); ->limit(3)->get();
$navigation = IndexNavigation::query() $navigation = IndexNavigation::query()
......
...@@ -60,11 +60,13 @@ class IndexController extends Controller ...@@ -60,11 +60,13 @@ class IndexController extends Controller
$article1 = ArticleInfo::query() $article1 = ArticleInfo::query()
->where('language_type', '=', $language_type) ->where('language_type', '=', $language_type)
->limit(1) ->limit(1)
->orderBy('created_at','desc')
->first(); ->first();
$article2 = ArticleInfo::query() $article2 = ArticleInfo::query()
->where('language_type', '=', $language_type) ->where('language_type', '=', $language_type)
->limit(1) ->limit(1)
->orderBy('updated_at','desc')
->first(); ->first();
$alert_t = ArticleInfo::query() $alert_t = ArticleInfo::query()
......
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
<a class="slide-a"><img src="{{$val->path}} " style="height: 720px;"></a> <a class="slide-a"><img src="{{$val->path}} " style="height: 720px;"></a>
<div class="panel-more"> <div class="panel-more">
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enbrand_culture')}}"> <a href="{{$val->img_title}}">
<img src="{{asset('images/moreinfo.png')}}"> <img src="{{asset('images/moreinfo.png')}}">
</a> </a>
@else @else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment