切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
景龙
6 years ago
提交
bc96ddd0a2f8b690ddee8c4571196ec415b43d51
1 个父辈
5221c228
1 个管道 的构建
通过
耗费 1 秒
修改在首页显示视频
变更
9
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
108 行增加
和
21 行删除
app/portal/controller/IndexController.php
app/portal/controller/RegionController.php
public/themes/admin_simpleboot3/portal/admin_region_video/add.html
public/themes/admin_simpleboot3/portal/admin_region_video/edit.html
public/themes/admin_simpleboot3/portal/admin_region_video/index.html
public/themes/simpleboot3/portal/enjoy_detail.html
public/themes/simpleboot3/portal/region/get_star_detail.html
public/themes/simpleboot3/public/assets/css/index.css
public/themes/simpleboot3/public/assets/css/show.css
app/portal/controller/IndexController.php
查看文件 @
bc96ddd
...
...
@@ -77,19 +77,29 @@ class IndexController extends HomeBaseController
$this
->
assign
(
'res_month'
,
$month
);
//星域秀场->星球影院
$res_xqyy
=
cache
(
'res_xqyy'
);
if
(
!
$res_xqyy
){
$position
=
CityCategoryModel
::
xqyy
;
$field
=
'id,more,thumbnail'
;
$res_xqyy
=
$this
->
getChildArticle
(
$position
,
$field
,
1
);
foreach
(
$res_xqyy
as
&
$value
){
$video
=
json_decode
(
$value
[
'more'
],
true
);
$value
[
'video'
]
=
$video
[
'video'
];
}
if
(
$res_xqyy
){
$res_xqyy
=
$res_xqyy
[
0
];
}
cache
(
'res_xqyy'
,
$res_xqyy
,
86400
);
//有效期一天
// $res_xqyy = cache('res_xqyy');
// if(!$res_xqyy){
// $position = CityCategoryModel::xqyy;
// $field = 'id,more,thumbnail';
// $res_xqyy = $this->getVideoIndex($position,$field,1);
// foreach($res_xqyy as &$value){
// $video = json_decode($value['more'],true);
// $value['video'] = $video['video'];
// }
// if($res_xqyy){
// $res_xqyy = $res_xqyy[0];
// }
// cache('res_xqyy', $res_xqyy,86400);//有效期一天
// }
$position
=
CityCategoryModel
::
xqyy
;
$field
=
'id,more,thumbnail'
;
$res_xqyy
=
$this
->
getVideoIndex
(
$position
,
$field
,
1
);
foreach
(
$res_xqyy
as
&
$value
){
$video
=
json_decode
(
$value
[
'more'
],
true
);
$value
[
'video'
]
=
$video
[
'video'
];
}
if
(
$res_xqyy
){
$res_xqyy
=
$res_xqyy
[
0
];
}
$this
->
assign
(
'res_xqyy'
,
$res_xqyy
);
...
...
@@ -206,6 +216,28 @@ class IndexController extends HomeBaseController
return
$res
;
}
//获取显示首页视频
public
function
getVideoIndex
(
$position
,
$field
,
$limit
=
''
){
$pre
=
CityCategoryModel
::
pre
;
$limit
=
empty
(
$limit
)
?
0
:
$limit
;
$post_id
=
Db
::
table
(
$pre
.
'portal_category_post'
)
->
whereIn
(
'category_id'
,
$position
)
->
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
,
'is_show'
=>
1
])
->
field
(
$field
)
->
limit
(
$limit
)
->
order
(
'weigh desc'
)
->
select
()
->
toArray
();
return
$res
;
}
//获取推荐视频
public
function
getVideo
(
$position
,
$city_id
,
$field
,
$limit
=
''
){
$pre
=
CityCategoryModel
::
pre
;
...
...
app/portal/controller/RegionController.php
查看文件 @
bc96ddd
...
...
@@ -149,11 +149,10 @@ class RegionController extends HomeBaseController
$position
[
'city_id'
]
=
$city_id
;
$position
[
'category_id'
]
=
CityCategoryModel
::
xqyy
;
$field
=
'id,post_title,framing,release_time,city_id,more,thumbnail'
;
$star
=
new
StarController
();
$res
=
$star
->
getChildArticlePage
(
$position
,
$field
);
$res
=
$this
->
getVideoArticlePage
(
$position
,
$field
);
foreach
(
$res
[
'data'
][
'data'
]
as
&
$value
){
$more
=
json_decode
(
$value
[
'more'
],
true
);
$value
[
'video'
]
=
isset
(
$more
[
'video'
])
&&
!
empty
(
$more
[
'video'
])
?
$more
[
'video'
]
:
''
;
;
$value
[
'video'
]
=
isset
(
$more
[
'video'
])
&&
!
empty
(
$more
[
'video'
])
?
$more
[
'video'
]
:
''
;
$value
[
'city_name'
]
=
$this
->
getCityCategory
(
$value
[
'city_id'
]);
}
$this
->
assign
(
'res'
,
$res
[
'data'
]);
...
...
@@ -167,6 +166,34 @@ class RegionController extends HomeBaseController
return
$this
->
fetch
();
}
//获取更多视频
public
function
getVideoArticlePage
(
$position
,
$field
,
$limit
=
''
){
$pre
=
CityCategoryModel
::
pre
;
$limit
=
empty
(
$limit
)
?
$this
->
more_limit
:
$limit
;
$post_id
=
Db
::
table
(
$pre
.
'portal_category_post'
)
->
whereIn
(
'category_id'
,
$position
[
'category_id'
])
->
field
(
'post_id'
)
->
select
()
->
toArray
();
$post_id
=
array_column
(
$post_id
,
'post_id'
);
//查询文章
if
(
$position
[
'city_id'
]
==
0
){
//所有
$where
=
[
'delete_time'
=>
0
,
'is_show'
=>
0
];
}
else
{
$where
=
[
'city_id'
=>
$position
[
'city_id'
],
'delete_time'
=>
0
,
'is_show'
=>
0
];
}
$res
=
Db
::
table
(
$pre
.
'portal_post'
)
->
whereIn
(
'id'
,
$post_id
)
->
where
(
$where
)
->
field
(
$field
)
->
order
(
'weigh desc'
)
->
paginate
(
$limit
,
false
,[
'query'
=>
request
()
->
param
()]);
$arr
[
'data'
]
=
$res
->
toArray
();
$arr
[
'page'
]
=
$res
->
render
();
return
$arr
;
}
//获取城市名称
public
function
getVideoCityName
(){
$res
=
Db
::
name
(
'city_category'
)
...
...
public/themes/admin_simpleboot3/portal/admin_region_video/add.html
查看文件 @
bc96ddd
...
...
@@ -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"
/>
是:
<input
class=
""
type=
"radio"
name=
"post[is_show]"
value=
"1"
/>
</td>
</tr>
<tr>
<th>
视频
</th>
<td
class=
"form-inline"
>
<input
id=
"file-video"
class=
"form-control"
type=
"text"
name=
"post[more][video]"
...
...
public/themes/admin_simpleboot3/portal/admin_region_video/edit.html
查看文件 @
bc96ddd
...
...
@@ -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>
/>
是:
<input
class=
""
type=
"radio"
name=
"post[is_show]"
value=
"1"
<
eq
name=
"1"
value=
"$post.is_show"
>
checked
</eq>
/>
</td>
</tr>
<tr>
<th>
视频
</th>
<td
class=
"form-inline"
>
<input
id=
"file-video"
class=
"form-control"
type=
"text"
name=
"post[more][video]"
...
...
public/themes/admin_simpleboot3/portal/admin_region_video/index.html
查看文件 @
bc96ddd
...
...
@@ -45,6 +45,7 @@
<!--</notempty>-->
<th
width=
"50"
>
ID
</th>
<th
width=
"300"
>
标题
</th>
<th
width=
"200"
>
是否显示首页
</th>
<th
width=
"100"
>
缩略图
</th>
<th
width=
"80"
>
所属城市
</th>
<th
width=
"100"
>
取景
</th>
...
...
@@ -77,6 +78,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>
...
...
public/themes/simpleboot3/portal/enjoy_detail.html
查看文件 @
bc96ddd
...
...
@@ -40,7 +40,7 @@
<div
class=
"Wheel"
>
<div
class=
"swiper-container gallery-top swiper-no-swiping"
>
<div
class=
"swiper-wrapper"
>
<volist
name=
"res.image_url"
id=
"vo"
>
<volist
name=
"res.image_url"
id=
"vo"
offset=
"1"
>
<div
class=
"swiper-slide"
style=
'background-image:url({:cmf_get_image_url($vo.url)})'
></div>
</volist>
</div>
...
...
@@ -50,7 +50,7 @@
</div>
<div
class=
"swiper-container gallery-thumbs"
>
<div
class=
"swiper-wrapper"
>
<volist
name=
"res.image_url"
id=
"vo"
>
<volist
name=
"res.image_url"
id=
"vo"
offset=
"1"
>
<div
class=
"swiper-slide"
style=
"background-image:url({:cmf_get_image_url($vo.url)})"
></div>
</volist>
</div>
...
...
public/themes/simpleboot3/portal/region/get_star_detail.html
查看文件 @
bc96ddd
...
...
@@ -26,7 +26,7 @@
<img
src=
"{:cmf_get_image_url($res.avatar)}"
alt=
""
>
<div
class=
"show6_con_top2"
>
<h1>
{$res.full_name}
</h1>
<h2>
{$res.position} {$res.trade}
</h2>
<h2
style=
"margin-top:10px;"
>
{$res.position} {$res.trade}
</h2>
<!--<span>{$res.create_time|date="Y-m-d",###}</span>-->
<p
class=
"show6_con_top3"
>
{$res.post_excerpt}
...
...
public/themes/simpleboot3/public/assets/css/index.css
查看文件 @
bc96ddd
...
...
@@ -195,9 +195,8 @@ p {
#star_main
.star_happy
.happy_title
p
:last-child
{
font-size
:
16px
;
opacity
:
0.8
;
margin-top
:
18px
;
font-family
:
Quicksand-Bold
;
color
:
white
;
}
...
...
public/themes/simpleboot3/public/assets/css/show.css
查看文件 @
bc96ddd
...
...
@@ -892,6 +892,7 @@ body {
font-size
:
28px
;
font-weight
:
bold
;
color
:
rgba
(
26
,
26
,
26
,
1
);
margin-bottom
:
40px
;
}
.show_4_con1
span
{
...
...
请
注册
或
登录
后发表评论