切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
景龙
6 years ago
提交
1a31c4a5dbcd2fbb0c1af982a14812860ff83db3
1 个父辈
3b734302
1 个管道 的构建
通过
耗费 0 秒
增加后台视频的首页封面图字段,解决封面图片变形问题
变更
5
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
66 行增加
和
34 行删除
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/simpleboot3/portal/index/index.html
app/portal/controller/IndexController.php
查看文件 @
1a31c4a
...
...
@@ -92,7 +92,7 @@ class IndexController extends HomeBaseController
// cache('res_xqyy', $res_xqyy,86400);//有效期一天
// }
$position
=
CityCategoryModel
::
xqyy
;
$field
=
'id,more,thumbnail'
;
$field
=
'id,more,
index_
thumbnail'
;
$res_xqyy
=
$this
->
getVideoIndex
(
$position
,
$field
,
1
);
foreach
(
$res_xqyy
as
&
$value
){
$video
=
json_decode
(
$value
[
'more'
],
true
);
...
...
app/portal/controller/RegionController.php
查看文件 @
1a31c4a
...
...
@@ -149,7 +149,7 @@ 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'
;
$res
=
$
this
->
getVideo
ArticlePage
(
$position
,
$field
);
$res
=
$
star
->
getChild
ArticlePage
(
$position
,
$field
);
foreach
(
$res
[
'data'
][
'data'
]
as
&
$value
){
$more
=
json_decode
(
$value
[
'more'
],
true
);
$value
[
'video'
]
=
isset
(
$more
[
'video'
])
&&
!
empty
(
$more
[
'video'
])
?
$more
[
'video'
]
:
''
;
...
...
@@ -166,34 +166,6 @@ 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
查看文件 @
1a31c4a
...
...
@@ -113,7 +113,26 @@
<div
class=
"col-md-3"
>
<table
class=
"table table-bordered"
>
<tr>
<th><b>
视频封面图
<span
class=
"form-required"
>
*
</span></b></th>
<th><b>
视频首页封面图
</b></th>
</tr>
<tr>
<td>
<div
style=
"text-align: center;"
>
<input
type=
"hidden"
name=
"post[index_thumbnail]"
id=
"index_thumbnail"
value=
""
>
<a
href=
"javascript:uploadOneImage('图片上传','#index_thumbnail');"
>
<img
src=
"__TMPL__/public/assets/images/default-thumbnail.png"
id=
"index_thumbnail-preview"
width=
"135"
style=
"cursor: pointer"
/>
</a>
<input
type=
"button"
class=
"btn btn-sm btn-cancel-index_thumbnail"
value=
"取消图片"
>
</div>
<div
style=
"margin-top:30px;"
>
<span
class=
"form-required"
>
图片参考尺寸:1200*675
</span>
</div>
</td>
</tr>
<tr>
<th><b>
视频更多封面图
<span
class=
"form-required"
>
*
</span></b></th>
</tr>
<tr>
<td>
...
...
@@ -126,6 +145,9 @@
</a>
<input
type=
"button"
class=
"btn btn-sm btn-cancel-thumbnail"
value=
"取消图片"
>
</div>
<div
style=
"margin-top:30px;"
>
<span
class=
"form-required"
>
图片参考尺寸:955*426
</span>
</div>
</td>
</tr>
<tr>
...
...
@@ -160,7 +182,11 @@
editorcontent
.
sync
();
}
catch
(
err
)
{
}
//首页缩略图
$
(
'.btn-cancel-index_thumbnail'
).
click
(
function
()
{
$
(
'#index_thumbnail-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#index_thumbnail'
).
val
(
''
);
});
$
(
'.btn-cancel-thumbnail'
).
click
(
function
()
{
$
(
'#thumbnail-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#thumbnail'
).
val
(
''
);
...
...
public/themes/admin_simpleboot3/portal/admin_region_video/edit.html
查看文件 @
1a31c4a
...
...
@@ -112,7 +112,33 @@
<div
class=
"col-md-3"
>
<table
class=
"table table-bordered"
>
<tr>
<th>
视频封面图
<span
class=
"form-required"
>
*
</span></th>
<th>
首页视频封面图
</th>
</tr>
<tr>
<td>
<div
style=
"text-align: center;"
>
<input
type=
"hidden"
name=
"post[index_thumbnail]"
id=
"index_thumbnail"
value=
"{$post.index_thumbnail|default=''}"
>
<a
href=
"javascript:uploadOneImage('图片上传','#index_thumbnail');"
>
<if
condition=
"empty($post.index_thumbnail)"
>
<img
src=
"__TMPL__/public/assets/images/default-thumbnail.png"
id=
"index_thumbnail-preview"
width=
"135"
style=
"cursor: pointer"
/>
<else/>
<img
src=
"{:cmf_get_image_preview_url($post.index_thumbnail)}"
id=
"index_thumbnail-preview"
width=
"135"
style=
"cursor: pointer"
/>
</if>
</a>
<input
type=
"button"
class=
"btn btn-sm btn-cancel-index_thumbnail"
value=
"取消图片"
>
</div>
<div
style=
"margin-top:30px;"
>
<span
class=
"form-required"
>
图片参考尺寸:1200*675
</span>
</div>
</td>
</tr>
<tr>
<th>
视频更多封面图
<span
class=
"form-required"
>
*
</span></th>
</tr>
<tr>
<td>
...
...
@@ -132,6 +158,9 @@
</a>
<input
type=
"button"
class=
"btn btn-sm btn-cancel-thumbnail"
value=
"取消图片"
>
</div>
<div
style=
"margin-top:30px;"
>
<span
class=
"form-required"
>
图片参考尺寸:955*426
</span>
</div>
</td>
</tr>
<tr>
...
...
@@ -173,6 +202,11 @@
}
catch
(
err
)
{
}
//首页缩略图
$
(
'.btn-cancel-index_thumbnail'
).
click
(
function
()
{
$
(
'#index_thumbnail-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#index_thumbnail'
).
val
(
''
);
});
$
(
'.btn-cancel-thumbnail'
).
click
(
function
()
{
$
(
'#thumbnail-preview'
).
attr
(
'src'
,
'__TMPL__/public/assets/images/default-thumbnail.png'
);
$
(
'#thumbnail'
).
val
(
''
);
...
...
public/themes/simpleboot3/portal/index/index.html
查看文件 @
1a31c4a
...
...
@@ -688,7 +688,7 @@
<div
class=
"star_video"
>
<notempty
name=
"res_xqyy"
>
<video
id=
"video"
width=
"100%"
height=
"675"
src=
"{:cmf_get_file_download_url($res_xqyy.video)}"
controlsList=
"nodownload"
></video>
<img
class=
"show_in_poster"
src=
"{:cmf_get_image_url($res_xqyy.thumbnail)}"
alt=
""
>
<img
class=
"show_in_poster"
src=
"{:cmf_get_image_url($res_xqyy.
index_
thumbnail)}"
alt=
""
>
<else/>
<video
id=
"video"
width=
"100%"
height=
"675"
src=
"__TMPL__//public/assets/starImg/video.mp4"
controlsList=
"nodownload"
></video>
<img
class=
"show_in_poster"
src=
"__TMPL__/public/assets/starImg/bicon_34.png"
alt=
""
>
...
...
请
注册
或
登录
后发表评论