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

dep

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