Commit 9c04bef3 authored by 章建武's avatar 章建武

dep

parent 432183e7
...@@ -49,6 +49,12 @@ class ArticleController extends Controller ...@@ -49,6 +49,12 @@ class ArticleController extends Controller
$param['release_time'] = time(); $param['release_time'] = time();
$param['url'] = 'http://'.$_SERVER['SERVER_NAME']; $param['url'] = 'http://'.$_SERVER['SERVER_NAME'];
$where = [
'language_type' => $param['language_type']
];
$num = $model->where($where)->count();
$num ++;
$param['num'] = $num;
$validate_result = $validate->scene('add')->check($param); $validate_result = $validate->scene('add')->check($param);
if (!$validate_result) { if (!$validate_result) {
return error($validate->getError()); return error($validate->getError());
......
...@@ -119,17 +119,19 @@ class ArticleController extends Controller ...@@ -119,17 +119,19 @@ class ArticleController extends Controller
$en = $en_url; $en = $en_url;
$type = $request->get('type'); $type = $request->get('type');
$id = $request->post('id'); $id = $request->post('id');
$num = $request->post('num');
ArticleInfo::where('id','=',$id)->increment('browse'); ArticleInfo::where('id','=',$id)->increment('browse');
$data = ArticleInfo::query()->where('type', '=', $type) $data = ArticleInfo::query()->where('type', '=', $type)
->where('id','<>',$id) ->where('id','<>',$id)
->where('status',0) ->where('status',0)
->where('language_type',$language_type) ->where('language_type',$language_type)
->orderBy('release_time','desc')
->limit(6) ->limit(6)
->get(); ->get();
$info = ArticleInfo::query() $info = ArticleInfo::query()
->where('id', $id)->first(); ->where('num', $num)
->where('language_type',$language_type)
->first();
$navigation = IndexNavigation::query() $navigation = IndexNavigation::query()
->where('is_link',0) ->where('is_link',0)
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<option>请选择年份</option> <option>请选择年份</option>
<option>2015</option> <option>2015</option>
<option>2014</option> <option>2014</option>
</select> f </select>
</form> </form>
</div>--> </div>-->
</div> </div>
...@@ -61,11 +61,11 @@ ...@@ -61,11 +61,11 @@
</div> </div>
<div class="news-more"> <div class="news-more">
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enarticle',['id'=>$val->id,'type'=>$val->type])}}"> <a href="{{route('enarticle',['num'=>$val->num,'type'=>$val->type])}}">
Continue reading >> Continue reading >>
</a> </a>
@else @else
<a href="{{route('article',['id'=>$val->id,'type'=>$val->type])}}"> <a href="{{route('article',['num'=>$val->num,'type'=>$val->type])}}">
继续阅读 >> 继续阅读 >>
</a> </a>
@endif @endif
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
@foreach($data as $va) @foreach($data as $va)
<li> <li>
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enarticle',['id'=>$va->id,'type'=>$val->type])}}" class="clearfix"> <a href="{{route('enarticle',['num'=>$va->num,'type'=>$val->type])}}" class="clearfix">
<div class="news-yue"> <div class="news-yue">
<strong>{{date('d',$va->release_time)}}</strong> <strong>{{date('d',$va->release_time)}}</strong>
<p>{{date('Y-m',$va->release_time)}}</p> <p>{{date('Y-m',$va->release_time)}}</p>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<span class="icon-right-open-big"></span> <span class="icon-right-open-big"></span>
</a> </a>
@else @else
<a href="{{route('article',['id'=>$va->id,'type'=>$val->type])}}" class="clearfix"> <a href="{{route('article',['num'=>$va->num,'type'=>$val->type])}}" class="clearfix">
<div class="news-yue"> <div class="news-yue">
<strong>{{date('d',$va->release_time)}}</strong> <strong>{{date('d',$va->release_time)}}</strong>
<p>{{date('Y-m',$va->release_time)}}</p> <p>{{date('Y-m',$va->release_time)}}</p>
......
...@@ -51,11 +51,11 @@ ...@@ -51,11 +51,11 @@
</div> </div>
<div class="news-more" > <div class="news-more" >
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enarticle',['id'=>$news_center->id,'type'=>$news_center->type])}}"> <a href="{{route('enarticle',['num'=>$news_center->num,'type'=>$news_center->type])}}">
Continue reading >> Continue reading >>
</a> </a>
@else @else
<a href="{{route('article',['id'=>$news_center->id,'type'=>$news_center->type])}}"> <a href="{{route('article',['num'=>$news_center->num,'type'=>$news_center->type])}}">
继续阅读 >> 继续阅读 >>
</a> </a>
@endif @endif
...@@ -89,11 +89,11 @@ ...@@ -89,11 +89,11 @@
{{--<p>{!! $news_center2->content !!}}</p>--}} {{--<p>{!! $news_center2->content !!}}</p>--}}
<div class="news-more"> <div class="news-more">
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enarticle',['id'=>$news_center2->id,'type'=>$news_center2->type])}}"> <a href="{{route('enarticle',['num'=>$news_center2->num,'type'=>$news_center2->type])}}">
Continue reading >> Continue reading >>
</a> </a>
@else @else
<a href="{{route('article',['id'=>$news_center2->id,'type'=>$news_center2->type])}}"> <a href="{{route('article',['num'=>$news_center2->num,'type'=>$news_center2->type])}}">
继续阅读 >> 继续阅读 >>
</a> </a>
@endif @endif
...@@ -133,9 +133,9 @@ ...@@ -133,9 +133,9 @@
</div> </div>
<div class="news-more"> <div class="news-more">
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enarticle',['id'=>$v->id,'type'=>2])}}">Continue reading >></a> <a href="{{route('enarticle',['num'=>$v->num,'type'=>2])}}">Continue reading >></a>
@else @else
<a href="{{route('article',['id'=>$v->id,'type'=>2])}}">继续阅读 >></a> <a href="{{route('article',['num'=>$v->num,'type'=>2])}}">继续阅读 >></a>
@endif @endif
</div> </div>
...@@ -158,13 +158,13 @@ ...@@ -158,13 +158,13 @@
@foreach($group_news as $va) @foreach($group_news as $va)
<li> <li>
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enarticle',['id'=>$va->id])}}"> <a href="{{route('enarticle',['num'=>$va->num])}}">
<span>{{date('Y-m-d',$va->release_time)}}</span> <span>{{date('Y-m-d',$va->release_time)}}</span>
<h1 class="ell1">{{$va->title}}</h1> <h1 class="ell1">{{$va->title}}</h1>
<p></p> <p></p>
</a> </a>
@else @else
<a href="{{route('article',['id'=>$va->id])}}"> <a href="{{route('article',['num'=>$va->num])}}">
<span>{{date('Y-m-d',$va->release_time)}}</span> <span>{{date('Y-m-d',$va->release_time)}}</span>
<h1 class="ell1">{{$va->title}}</h1> <h1 class="ell1">{{$va->title}}</h1>
<p></p> <p></p>
...@@ -207,9 +207,9 @@ ...@@ -207,9 +207,9 @@
</div> </div>
<div class="news-more"> <div class="news-more">
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enarticle',['id'=>$v->id,'type'=>$v->type])}}">Continue reading >></a> <a href="{{route('enarticle',['num'=>$v->num,'type'=>$v->type])}}">Continue reading >></a>
@else @else
<a href="{{route('article',['id'=>$v->id,'type'=>$v->type])}}">继续阅读 >></a> <a href="{{route('article',['num'=>$v->num,'type'=>$v->type])}}">继续阅读 >></a>
@endif @endif
</div> </div>
</div> </div>
...@@ -229,13 +229,13 @@ ...@@ -229,13 +229,13 @@
@foreach($item_trends2 as $va) @foreach($item_trends2 as $va)
<li> <li>
@if($language_type == 1) @if($language_type == 1)
<a href="{{route('enarticle',['id'=>$va->id,'type'=>$va->type])}}"> <a href="{{route('enarticle',['num'=>$va->num,'type'=>$va->type])}}">
<span>{{date('Y-m-d',$va->release_time)}}</span> <span>{{date('Y-m-d',$va->release_time)}}</span>
<h1 class="ell1">{{$va->title}}</h1> <h1 class="ell1">{{$va->title}}</h1>
<p>{{$va->introduce}}</p> <p>{{$va->introduce}}</p>
</a> </a>
@else @else
<a href="{{route('article',['id'=>$va->id,'type'=>$va->type])}}"> <a href="{{route('article',['num'=>$va->num,'type'=>$va->type])}}">
<span>{{date('Y-m-d',$va->release_time)}}</span> <span>{{date('Y-m-d',$va->release_time)}}</span>
<h1 class="ell1">{{$va->title}}</h1> <h1 class="ell1">{{$va->title}}</h1>
<p>{{$va->introduce}}</p> <p>{{$va->introduce}}</p>
......
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