添加帖子裂变浏览量,修复搜索多应用链接

This commit is contained in:
toogee 2020-05-21 16:58:06 +08:00
parent d537d05394
commit 0f912e8f52
5 changed files with 10 additions and 7 deletions

View File

@ -64,7 +64,7 @@ class Article extends BaseController
switch ($type) { switch ($type) {
//查询文章,15个分1页 //查询文章,15个分1页
case 'jie': case 'jie':
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([ $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([
'cate' => function($query){ 'cate' => function($query){
$query->where('delete_time',0)->field('id,catename'); $query->where('delete_time',0)->field('id,catename');
}, },
@ -80,7 +80,7 @@ class Article extends BaseController
break; break;
case 'hot': case 'hot':
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([ $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([
'cate' => function($query){ 'cate' => function($query){
$query->where('delete_time',0)->field('id,catename'); $query->where('delete_time',0)->field('id,catename');
}, },
@ -96,7 +96,7 @@ class Article extends BaseController
break; break;
case 'top': case 'top':
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([ $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([
'cate' => function($query){ 'cate' => function($query){
$query->where('delete_time',0)->field('id,catename'); $query->where('delete_time',0)->field('id,catename');
}, },
@ -112,7 +112,7 @@ class Article extends BaseController
break; break;
default: default:
$artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie')->with([ $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([
'cate' => function($query){ 'cate' => function($query){
$query->where('delete_time',0)->field('id,catename'); $query->where('delete_time',0)->field('id,catename');
}, },

View File

@ -28,4 +28,6 @@ Route::rule('postcode','login/postcode');
Route::rule('respass','login/respass'); Route::rule('respass','login/respass');
Route::rule('reg','Login/reg') Route::rule('reg','Login/reg')
->middleware(\app\middleware\CheckRegister::class); ->middleware(\app\middleware\CheckRegister::class);
Route::rule('search/[:keywords]', 'index/search'); // 搜索

View File

@ -705,7 +705,7 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util'], function(
,shadeClose: true ,shadeClose: true
,maxWidth: 10000 ,maxWidth: 10000
,skin: 'fly-layer-search' ,skin: 'fly-layer-search'
,content: ['<form action="/index/search">' ,content: ['<form action='+searchUrl+'>'
,'<input autocomplete="off" placeholder="搜索内容,回车跳转" type="text" name="keywords">' ,'<input autocomplete="off" placeholder="搜索内容,回车跳转" type="text" name="keywords">'
,'</form>'].join('') ,'</form>'].join('')
,success: function(layero){ ,success: function(layero){

View File

@ -34,7 +34,7 @@
</a> </a>
<span>{$art.create_time|date='Y-m-d'}</span> <span>{$art.create_time|date='Y-m-d'}</span>
<!--span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> 60</span--> <span class="layui-hide-xs" title="人气"><i class="iconfont" title="人气">&#xe60b;</i> {$art.pv}</span>
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>{/if} {if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>{/if}
<span class="fly-list-nums"> <span class="fly-list-nums">
<i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count} <i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}

View File

@ -237,6 +237,7 @@
}).extend({ }).extend({
fly: 'index' fly: 'index'
}).use('fly'); }).use('fly');
var replyurl = "{:url('index/reply')}"; var replyUrl = "{:url('index/reply')}",
searchUrl = "{:url('index/search')}";
</script> </script>
{/block} {/block}