作者 景龙
1 个管道 的构建 通过 耗费 0 秒

修改点赞相反

... ... @@ -51,16 +51,19 @@ class IndexController extends HomeBaseController
//星享体验
$res_month = $this->getMonthArticle();
$month = [];
foreach($res_month['data'] as &$value){
$month[$value['month']]['id'] = $value['id'];
$month[$value['month']]['month'] = $value['month'];
$month[$value['month']]['post_title'] = $value['post_title'];
$month[$value['month']]['index_thumbnail'] = $value['index_thumbnail'];
foreach($res_month['category_name'] as $value1){
if($value['id'] == $value1['post_id']){
$value['category_name'] = $value1['name'];
$month[$value['month']]['category_name'] = $value1['name'];
}
}
}
$last_names = array_column($res_month['data'],'month');
array_multisort($last_names,SORT_ASC,$res_month['data']);
$this->assign('res_month',$res_month['data']);
$this->assign('res_month',$month);
//星域秀场->星球影院
$position = CityCategoryModel::xqyy;
... ... @@ -231,18 +234,14 @@ class IndexController extends HomeBaseController
->select()
->toArray();
$c_id = array_column($category_id,'id');
//查询文章id
$post_id = Db::table($pre.'portal_category_post')
->whereIn('category_id',$c_id)
->field('post_id')
->select()
->toArray();
$post_id = array_column($post_id,'post_id');
//查询文章
$res = Db::table($pre.'portal_post')
->whereIn('id',$post_id)
->where('delete_time', 0)
->field('id,month,post_title,index_thumbnail')
$res = Db::name('portal_post')
->alias('p')
->join('portal_category_post c','p.id = c.post_id','LEFT')
->whereIn('c.category_id',$c_id)
->where('p.is_show',1)
->where('p.delete_time', 0)
->field('p.id,p.month,p.post_title,p.index_thumbnail')
->order('weigh desc')
->group('month')
->select()
... ...
... ... @@ -57,6 +57,14 @@
</td>
</tr>
<tr>
<th>是否显示首页<span class="form-required">*</span></th>
<td>
否:<input class="" type="radio" name="post[is_show]" checked value="0"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
是:<input class="" type="radio" name="post[is_show]" value="1"/>
</td>
</tr>
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
... ...
... ... @@ -40,7 +40,7 @@
<div class="col-md-9">
<table class="table table-bordered">
<tr class="city" id="city1">
<th width="100">城市分类<span class="form-required">*</span></th>
<th width="150">城市分类<span class="form-required">*</span></th>
<td>
<select class="form-control check_city" name="post[city_id]" id="input-parent" style="width:400px;">
<option value="">请选择城市</option>
... ... @@ -61,6 +61,14 @@
</td>
</tr>
<tr>
<th>是否显示首页<span class="form-required">*</span></th>
<td>
否:<input class="" type="radio" name="post[is_show]" value="0" <eq name="0" value="$post.is_show">checked</eq>/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
是:<input class="" type="radio" name="post[is_show]" value="1" <eq name="1" value="$post.is_show">checked</eq>/>
</td>
</tr>
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
... ...
... ... @@ -45,6 +45,7 @@
<!--</notempty>-->
<th width="50">ID</th>
<th width="400">标题</th>
<th width="200">是否显示首页</th>
<th width="100">月份</th>
<th width="100">缩略图</th>
<th width="80">所属城市</th>
... ... @@ -75,6 +76,17 @@
{$vo.post_title}
</notempty>
</td>
<td>
<empty name="vo.is_show">
<span class="label label-default">
隐藏
</span>
<else/>
<span class="label label-success">
显示
</span>
</empty>
</td>
<td>{$vo.month}</td>
<td>
<notempty name="vo.more.thumbnail">
... ...
... ... @@ -57,6 +57,14 @@
</td>
</tr>
<tr>
<th>是否显示首页<span class="form-required">*</span></th>
<td>
否:<input class="" type="radio" name="post[is_show]" checked value="0"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
是:<input class="" type="radio" name="post[is_show]" value="1"/>
</td>
</tr>
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
... ...
... ... @@ -40,7 +40,7 @@
<div class="col-md-9">
<table class="table table-bordered">
<tr class="city" id="city1">
<th width="100">城市分类<span class="form-required">*</span></th>
<th width="150">城市分类<span class="form-required">*</span></th>
<td>
<select class="form-control check_city" name="post[city_id]" id="input-parent" style="width:400px;">
<option value="">请选择城市</option>
... ... @@ -61,6 +61,14 @@
</td>
</tr>
<tr>
<th>是否显示首页<span class="form-required">*</span></th>
<td>
否:<input class="" type="radio" name="post[is_show]" value="0" <eq name="0" value="$post.is_show">checked</eq>/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
是:<input class="" type="radio" name="post[is_show]" value="1" <eq name="1" value="$post.is_show">checked</eq>/>
</td>
</tr>
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
... ...
... ... @@ -45,6 +45,7 @@
<!--</notempty>-->
<th width="50">ID</th>
<th width="400">标题</th>
<th width="200">是否显示首页</th>
<th width="100">月份</th>
<th width="100">缩略图</th>
<th width="80">所属城市</th>
... ... @@ -75,6 +76,17 @@
{$vo.post_title}
</notempty>
</td>
<td>
<empty name="vo.is_show">
<span class="label label-default">
隐藏
</span>
<else/>
<span class="label label-success">
显示
</span>
</empty>
</td>
<td>{$vo.month}</td>
<td>
<notempty name="vo.more.thumbnail">
... ...
... ... @@ -57,6 +57,14 @@
</td>
</tr>
<tr>
<th>是否显示首页<span class="form-required">*</span></th>
<td>
否:<input class="" type="radio" name="post[is_show]" checked value="0"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
是:<input class="" type="radio" name="post[is_show]" value="1"/>
</td>
</tr>
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
... ...
... ... @@ -40,7 +40,7 @@
<div class="col-md-9">
<table class="table table-bordered">
<tr class="city" id="city1">
<th width="100">城市分类<span class="form-required">*</span></th>
<th width="150">城市分类<span class="form-required">*</span></th>
<td>
<select class="form-control check_city" name="post[city_id]" id="input-parent" style="width:400px;">
<option value="">请选择城市</option>
... ... @@ -61,6 +61,14 @@
</td>
</tr>
<tr>
<th>是否显示首页<span class="form-required">*</span></th>
<td>
否:<input class="" type="radio" name="post[is_show]" value="0" <eq name="0" value="$post.is_show">checked</eq>/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
是:<input class="" type="radio" name="post[is_show]" value="1" <eq name="1" value="$post.is_show">checked</eq>/>
</td>
</tr>
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
... ...
... ... @@ -45,6 +45,7 @@
<!--</notempty>-->
<th width="50">ID</th>
<th width="400">标题</th>
<th width="200">是否显示首页</th>
<th width="100">月份</th>
<th width="100">缩略图</th>
<th width="80">所属城市</th>
... ... @@ -75,6 +76,17 @@
{$vo.post_title}
</notempty>
</td>
<td>
<empty name="vo.is_show">
<span class="label label-default">
隐藏
</span>
<else/>
<span class="label label-success">
显示
</span>
</empty>
</td>
<td>{$vo.month}</td>
<td>
<notempty name="vo.more.thumbnail">
... ...
... ... @@ -37,7 +37,7 @@
<div class="col-md-9">
<table class="table table-bordered">
<tr class="city" id="city1">
<th width="100">城市分类<span class="form-required">*</span></th>
<th width="150">城市分类<span class="form-required">*</span></th>
<td>
<select class="form-control check_city" name="post[city_id]" id="input-parent" style="width:400px;">
<option value="">请选择城市</option>
... ... @@ -57,6 +57,14 @@
</td>
</tr>
<tr>
<th>是否显示首页<span class="form-required">*</span></th>
<td>
否:<input class="" type="radio" name="post[is_show]" checked value="0"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
是:<input class="" type="radio" name="post[is_show]" value="1"/>
</td>
</tr>
<tr>
<th width="100">月份<span class="form-required">*</span></th>
<td>
<select class="form-control" name="post[month]" style="width:400px;">
... ...
... ... @@ -40,7 +40,7 @@
<div class="col-md-9">
<table class="table table-bordered">
<tr class="city" id="city1">
<th width="100">城市分类<span class="form-required">*</span></th>
<th width="150">城市分类<span class="form-required">*</span></th>
<td>
<select class="form-control check_city" name="post[city_id]" id="input-parent" style="width:400px;">
<option value="">请选择城市</option>
... ... @@ -61,6 +61,14 @@
</td>
</tr>
<tr>
<th>是否显示首页<span class="form-required">*</span></th>
<td>
否:<input class="" type="radio" name="post[is_show]" value="0" <eq name="0" value="$post.is_show">checked</eq>/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
是:<input class="" type="radio" name="post[is_show]" value="1" <eq name="1" value="$post.is_show">checked</eq>/>
</td>
</tr>
<tr>
<th>简介<span class="form-required">*</span></th>
<td>
<textarea class="form-control" required name="post[post_excerpt]" style="height: 50px;"
... ...
... ... @@ -45,6 +45,7 @@
<!--</notempty>-->
<th width="50">ID</th>
<th width="400">标题</th>
<th width="200">是否显示首页</th>
<th width="100">月份</th>
<th width="100">缩略图</th>
<th width="80">所属城市</th>
... ... @@ -75,6 +76,17 @@
{$vo.post_title}
</notempty>
</td>
<td>
<empty name="vo.is_show">
<span class="label label-default">
隐藏
</span>
<else/>
<span class="label label-success">
显示
</span>
</empty>
</td>
<td>{$vo.month}</td>
<td>
<notempty name="vo.more.thumbnail">
... ...
... ... @@ -45,6 +45,7 @@
<!--</notempty>-->
<th width="50">ID</th>
<th width="400">标题</th>
<th width="200">是否显示更多页</th>
<th width="100">缩略图</th>
<th width="80">所属城市</th>
<th width="65">点击量</th>
... ... @@ -75,6 +76,17 @@
</notempty>
</td>
<td>
<empty name="vo.is_show">
<span class="label label-default">
隐藏
</span>
<else/>
<span class="label label-success">
显示
</span>
</empty>
</td>
<td>
<notempty name="vo.more.thumbnail">
<a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.more.thumbnail)}');">
<i class="fa fa-photo fa-fw"></i>
... ...
... ... @@ -58,13 +58,15 @@
</head>
<body>
<!-- 弹框视频 -->
<div class="mask" id="mask">
<div class="mask_video" >
<img id="nos" src="__TMPL__/public/assets/starImg/nos.png" alt="">
<video id="video2" src="{:cmf_get_file_download_url($res_djxq.video)}"></video>
</div>
</div>
<!-- 弹框视频 -->
<notempty name="res_djxq.video">
<div class="mask" id="mask">
<div class="mask_video" >
<img id="nos" src="__TMPL__/public/assets/starImg/nos.png" alt="">
<video id="video2" src="{:cmf_get_file_download_url($res_djxq.video)}"></video>
</div>
</div>
</notempty>
<!-- 侧边 -->
<div class="index_sidebar">
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1309572580&site=qq&menu=yes">
... ... @@ -223,15 +225,15 @@
<p>January</p>
</div>
<!-- 图片 -->
<notempty name="res_month.0">
<notempty name="res_month.1">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.0.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.1.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.0.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.1.id}">
<div class="img_bottom">
<p>{$res_month.0.post_title}</p>
<p>{$res_month.0.category_name}</p>
<p>{$res_month.1.post_title}</p>
<p>{$res_month.1.category_name}</p>
</div>
</a>
<else/>
... ... @@ -260,15 +262,15 @@
<p>February</p>
</div>
<!-- 图片 -->
<notempty name="res_month.1">
<notempty name="res_month.2">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.1.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.2.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.1.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.2.id}">
<div class="img_bottom">
<p>{$res_month.1.post_title}</p>
<p>{$res_month.1.category_name}</p>
<p>{$res_month.2.post_title}</p>
<p>{$res_month.2.category_name}</p>
</div>
</a>
<else/>
... ... @@ -298,15 +300,15 @@
<p>March</p>
</div>
<!-- 图片 -->
<notempty name="res_month.2">
<notempty name="res_month.3">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.2.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.3.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.2.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.3.id}">
<div class="img_bottom">
<p>{$res_month.2.post_title}</p>
<p>{$res_month.2.category_name}</p>
<p>{$res_month.3.post_title}</p>
<p>{$res_month.3.category_name}</p>
</div>
</a>
<else/>
... ... @@ -337,15 +339,15 @@
<p>April</p>
</div>
<!-- 图片 -->
<notempty name="res_month.3">
<notempty name="res_month.4">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.3.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.4.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.3.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.4.id}">
<div class="img_bottom">
<p>{$res_month.3.post_title}</p>
<p>{$res_month.3.category_name}</p>
<p>{$res_month.4.post_title}</p>
<p>{$res_month.4.category_name}</p>
</div>
</a>
<else/>
... ... @@ -375,15 +377,15 @@
<p>May</p>
</div>
<!-- 图片 -->
<notempty name="res_month.4">
<notempty name="res_month.5">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.4.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.5.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.4.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.5.id}">
<div class="img_bottom">
<p>{$res_month.4.post_title}</p>
<p>{$res_month.4.category_name}</p>
<p>{$res_month.5.post_title}</p>
<p>{$res_month.5.category_name}</p>
</div>
</a>
<else/>
... ... @@ -412,15 +414,15 @@
<p>June</p>
</div>
<!-- 图片 -->
<notempty name="res_month.5">
<notempty name="res_month.6">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.5.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.6.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.5.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.6.id}">
<div class="img_bottom">
<p>{$res_month.5.post_title}</p>
<p>{$res_month.5.category_name}</p>
<p>{$res_month.6.post_title}</p>
<p>{$res_month.6.category_name}</p>
</div>
</a>
<else/>
... ... @@ -451,15 +453,15 @@
<p>July</p>
</div>
<!-- 图片 -->
<notempty name="res_month.6">
<notempty name="res_month.7">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.6.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.7.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.6.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.7.id}">
<div class="img_bottom">
<p>{$res_month.6.post_title}</p>
<p>{$res_month.6.category_name}</p>
<p>{$res_month.7.post_title}</p>
<p>{$res_month.7.category_name}</p>
</div>
</a>
<else/>
... ... @@ -490,15 +492,15 @@
<p>August</p>
</div>
<!-- 图片 -->
<notempty name="res_month.7">
<notempty name="res_month.8">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.7.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.8.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.7.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.8.id}">
<div class="img_bottom">
<p>{$res_month.7.post_title}</p>
<p>{$res_month.7.category_name}</p>
<p>{$res_month.8.post_title}</p>
<p>{$res_month.8.category_name}</p>
</div>
</a>
<else/>
... ... @@ -529,15 +531,15 @@
<p>September</p>
</div>
<!-- 图片 -->
<notempty name="res_month.8">
<notempty name="res_month.9">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.8.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.9.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.8.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.9.id}">
<div class="img_bottom">
<p>{$res_month.8.post_title}</p>
<p>{$res_month.8.category_name}</p>
<p>{$res_month.9.post_title}</p>
<p>{$res_month.9.category_name}</p>
</div>
</a>
<else/>
... ... @@ -566,15 +568,15 @@
<p>October</p>
</div>
<!-- 图片 -->
<notempty name="res_month.9">
<notempty name="res_month.10">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.9.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.10.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.9.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.10.id}">
<div class="img_bottom">
<p>{$res_month.9.post_title}</p>
<p>{$res_month.9.category_name}</p>
<p>{$res_month.10.post_title}</p>
<p>{$res_month.10.category_name}</p>
</div>
</a>
<else/>
... ... @@ -605,15 +607,15 @@
<p>November</p>
</div>
<!-- 图片 -->
<notempty name="res_month.10">
<notempty name="res_month.11">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.10.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.11.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.10.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.11.id}">
<div class="img_bottom">
<p>{$res_month.10.post_title}</p>
<p>{$res_month.10.category_name}</p>
<p>{$res_month.11.post_title}</p>
<p>{$res_month.11.category_name}</p>
</div>
</a>
<else/>
... ... @@ -644,15 +646,15 @@
<p>December</p>
</div>
<!-- 图片 -->
<notempty name="res_month.11">
<notempty name="res_month.12">
<div class="reverse_Imgs">
<img src="{:cmf_get_image_url($res_month.11.index_thumbnail)}"/>
<img src="{:cmf_get_image_url($res_month.12.index_thumbnail)}"/>
</div>
<!-- 图片下方文字 -->
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.11.id}">
<a href="/portal/enjoy/getEnjoyDetail?id={$res_month.12.id}">
<div class="img_bottom">
<p>{$res_month.11.post_title}</p>
<p>{$res_month.11.category_name}</p>
<p>{$res_month.12.post_title}</p>
<p>{$res_month.12.category_name}</p>
</div>
</a>
<else/>
... ...
$(function(){
var host = 'http://'+window.location.host;
// 点赞
$('.likes').click(function() {
// 收藏
$('.collections').click(function() {
if ($(this).children('img').attr('src') == host+'/themes/simpleboot3/public/assets/starImg/bicon_02.png') {
var login = operation('/portal/star/like');
var login = operation('/portal/star/collection');
if(login == 0){
return false;
}
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_15.png');
} else {
var login = operation('/portal/star/cancelLike');
var login = operation('/portal/star/cancelCollection');
if(login == 0){
return false;
}
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_02.png');
}
});
//收藏
$('.collections').click(function() {
//点赞
$('.likes').click(function() {
if ($(this).children('img').attr('src') == host+'/themes/simpleboot3/public/assets/starImg/bicon_03.png') {
var login = operation('/portal/star/collection');
var login = operation('/portal/star/like');
if(login == 0){
return false;
}
$(this).children('img').attr('src', host+'/themes/simpleboot3/public/assets/starImg/bicon_16.png');
} else {
var login = operation('/portal/star/cancelCollection');
var login = operation('/portal/star/cancelLike');
if(login == 0){
return false;
}
... ...
<div class="sidebar">
<!-- 点赞 -->
<div class="likes">
<notempty name="is_like">
<!-- 收藏 -->
<div class="collections">
<notempty name="is_collection">
<img src="__TMPL__/public/assets/starImg/bicon_15.png" alt="">
<else/>
<img src="__TMPL__/public/assets/starImg/bicon_02.png" alt="">
</notempty>
</div>
<!-- 收藏 -->
<div class="collections">
<notempty name="is_collection">
<!-- 点赞 -->
<div class="likes">
<notempty name="is_like">
<img src="__TMPL__/public/assets/starImg/bicon_16.png" alt="">
<else/>
<img src="__TMPL__/public/assets/starImg/bicon_03.png" alt="">
... ...