切换导航条
此项目
正在载入...
登录
郭盛
/
cloud
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Cool
4 years ago
提交
0f1c5c0ab0233ad98a4d4f5e13ad89713380bdf5
1 个父辈
bd3a3c91
1 个管道 的构建
通过
耗费 1 秒
h5分享下载app调试
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
412 行增加
和
41 行删除
application/index/controller/Index.php
application/index/view/index/pilot.html
application/index/controller/Index.php
查看文件 @
0f1c5c0
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
分享详情
</title>
<link
rel=
"stylesheet"
href=
"/assets/cai/css/common.css"
>
<link
rel=
"stylesheet"
href=
"/assets/cai/css/file.css"
>
<style>
html
,
body
{
width
:
100%
;
margin
:
0
;
}
.browser_open
{
position
:
absolute
;
top
:
0
;
background
:
rgb
(
51
,
51
,
51
);
z-index
:
111
;
width
:
100%
;
height
:
100%
;
font-size
:
0
;
}
.browser_open
img
{
width
:
100%
;
font-size
:
0
;
}
</style>
</head>
<body>
<div
class=
"top"
>
彩云盘
</div>
<div
class=
"browser_open"
>
<img
src=
"__CDN__/assets/cai/image/browser.png"
/>
</div>
</body>
</html>
\ No newline at end of file
<?php
namespace
app\index\controller
;
use
app\api\controller\Message
;
use
app\common\controller\Frontend
;
use
think\Db
;
class
Index
extends
Frontend
{
protected
$noNeedLogin
=
'*'
;
protected
$noNeedRight
=
'*'
;
protected
$layout
=
''
;
protected
$browser
;
public
function
_initialize
()
{
parent
::
_initialize
();
// TODO: Change the autogenerated stub
$href
=
''
;
$this
->
browser
=
0
;
$switch
=
Db
::
name
(
'open'
)
->
where
(
'id'
,
2
)
->
value
(
'switch'
);
if
(
$switch
==
1
)
{
if
(
strpos
(
$_SERVER
[
'HTTP_USER_AGENT'
],
'MicroMessenger'
)
==
true
)
{
$this
->
browser
=
1
;
}
else
if
(
strpos
(
$_SERVER
[
'HTTP_USER_AGENT'
],
'AlipayClient'
)
==
true
)
{
$this
->
browser
=
2
;
}
else
{
if
(
stristr
(
$_SERVER
[
'HTTP_USER_AGENT'
],
'Android'
))
{
//echo '你的手机是:Android系统';
$href
=
request
()
->
domain
()
.
'/package/android_debug.apk'
;
}
else
if
(
stristr
(
$_SERVER
[
'HTTP_USER_AGENT'
],
'iPhone'
))
{
//echo '你的手机是:ISO系统';
$this
->
browser
=
3
;
}
}
}
$this
->
view
->
assign
(
'href'
,
$href
);
$this
->
view
->
assign
(
'browser'
,
$this
->
browser
);
}
public
function
index
()
{
return
$this
->
view
->
fetch
();
}
public
function
download
()
{
$href
=
''
;
$browser
=
0
;
if
(
strpos
(
$_SERVER
[
'HTTP_USER_AGENT'
],
'MicroMessenger'
)
==
true
)
{
$browser
=
1
;
}
else
if
(
strpos
(
$_SERVER
[
'HTTP_USER_AGENT'
],
'AlipayClient'
)
==
true
)
{
$browser
=
2
;
}
if
(
stristr
(
$_SERVER
[
'HTTP_USER_AGENT'
],
'Android'
))
{
//echo '你的手机是:Android系统';
// $ver = Db::name('version')->order('id', 'DESC')->find();
$href
=
request
()
->
domain
()
.
'/package/android_debug.apk'
;
}
else
if
(
stristr
(
$_SERVER
[
'HTTP_USER_AGENT'
],
'iPhone'
))
{
//echo '你的手机是:ISO系统';
$browser
=
3
;
}
$this
->
assign
(
'url'
,
$href
);
$this
->
assign
(
'browser'
,
$browser
);
return
$this
->
view
->
fetch
();
}
//会有到期提醒 添加信息记录
public
function
mess
()
{
$data
=
Db
::
name
(
'user'
)
->
field
(
'id,identity,audit,expirationtime'
)
->
where
(
'identity'
,
'neq'
,
1
)
->
where
(
'audit'
,
1
)
->
select
();
foreach
(
$data
as
&
$v
){
if
(
time
()
>
$v
[
'expirationtime'
]){
$message
=
new
Message
();
$message
->
add
(
$v
[
'id'
],
'会员到期'
);
}
else
{
if
(
time
()
+
86400
>=
$v
[
'expirationtime'
]){
$message
=
new
Message
();
$message
->
add
(
$v
[
'id'
],
'会员1天后到期'
);
}
else
{
if
(
time
()
+
2
*
86400
>=
$v
[
'expirationtime'
]){
$message
=
new
Message
();
$message
->
add
(
$v
[
'id'
],
'会员2天后到期'
);
}
else
{
if
(
time
()
+
3
*
86400
>=
$v
[
'expirationtime'
]){
$message
=
new
Message
();
$message
->
add
(
$v
[
'id'
],
'会员3天后到期'
);
}
}
}
}
}
}
//文件详情
public
function
detail
()
{
if
(
in_array
(
$this
->
browser
,[
1
,
2
]))
{
return
$this
->
fetch
(
'pilot'
);
}
$qiniu
=
get_addon_config
(
'qiniu'
)[
'cdnurl'
];
$user_id
=
$this
->
request
->
param
(
'user_id'
);
$file_id
=
$this
->
request
->
param
(
'file_id'
);
$data
=
Db
::
name
(
'savemes'
)
->
where
(
'id'
,
$file_id
)
->
find
();
if
(
$data
[
'is_open'
]
==
2
){
$this
->
error
(
'该文件为私密,请在APP内打开'
);
}
if
(
$data
[
'type'
]
==
2
){
$data
[
'video'
]
=
''
;
$data
[
'video_image'
]
=
''
;
$data
[
'content'
]
=
''
;
$data
[
'images'
]
=
$qiniu
.
$data
[
'images'
];
$data_video
=
Db
::
name
(
'open'
)
->
where
(
'id'
,
1
)
->
find
();
$data
[
'switch'
]
=
$data_video
[
'switch'
];
}
elseif
(
$data
[
'type'
]
==
3
){
$data
[
'images'
]
=
''
;
$data
[
'content'
]
=
''
;
$data
[
'video'
]
=
$qiniu
.
$data
[
'video'
];
// 获取视频第一帧图片
$video_info
=
json_decode
(
file_get_contents
(
$data
[
'video'
]
.
'?avinfo'
),
true
);
$data
[
'video_image'
]
=
$this
->
get_video_first_image
(
$data
[
'video'
],
$video_info
);
$data_video
=
Db
::
name
(
'open'
)
->
where
(
'id'
,
1
)
->
find
();
$data
[
'switch'
]
=
$data_video
[
'switch'
];
}
elseif
(
$data
[
'type'
]
==
1
){
$data
[
'images'
]
=
''
;
$data
[
'video'
]
=
''
;
$data
[
'video_image'
]
=
''
;
$data_video
=
Db
::
name
(
'open'
)
->
where
(
'id'
,
1
)
->
find
();
$data
[
'switch'
]
=
$data_video
[
'switch'
];
}
$text
=
Db
::
name
(
'official'
)
->
where
(
'id'
,
1
)
->
find
();
$data
[
'introduce'
]
=
$text
[
'introduce'
];
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
();
}
//文件夹详情
public
function
filedetail
()
{
if
(
in_array
(
$this
->
browser
,[
1
,
2
]))
{
return
$this
->
fetch
(
'pilot'
);
}
$qiniu
=
get_addon_config
(
'qiniu'
)[
'cdnurl'
];
$user_id
=
$this
->
request
->
param
(
'user_id'
);
$file_id
=
$this
->
request
->
param
(
'file_id'
);
$info_res
=
Db
::
name
(
'folder'
)
->
where
(
'id'
,
$file_id
)
->
find
();
if
(
$info_res
[
'is_open'
]
==
2
){
$this
->
error
(
'该文件夹为私密,请在APP内打开'
);
}
//文件夹
$folder
=
Db
::
name
(
'folder'
)
->
where
(
'pid'
,
$file_id
)
->
where
(
'is_up'
,
1
)
->
select
();
foreach
(
$folder
as
&
$v
){
$v
[
'createtime'
]
=
date
(
'Y-m-d'
,
$v
[
'createtime'
]);
}
$times
=
array_values
(
array_unique
(
array_column
(
$folder
,
'createtime'
)));
//将数据放到对应的时间分段
$arrs
=
[];
foreach
(
$times
as
$t_k
=>
$t_v
){
$arrs
[
$t_k
][
'times'
]
=
$t_v
;
$k
=
0
;
foreach
(
$folder
as
$value
){
$k
+=
0
;
if
(
$t_v
==
$value
[
'createtime'
]){
$arrs
[
$t_k
][
'info'
][
$k
]
=
$value
;
$k
++
;
}
}
}
$data
[
'folder'
]
=
$arrs
;
//笔记
$note
[
'folder_id'
]
=
[
'eq'
,
$file_id
];
$note
[
'is_up'
]
=
[
'eq'
,
1
];
$z_tiao
[
'a.folder_id'
]
=
[
'eq'
,
$file_id
];
$z_tiao
[
'b.is_up'
]
=
[
'eq'
,
1
];
$note
=
$this
->
myfile
(
1
,
$note
);
$zhuan_note
=
$this
->
zhuan
(
1
,
$z_tiao
);
$gong
=
$this
->
gong
(
1
,
$note
,
$zhuan_note
);
$data
[
'note'
]
=
$this
->
sundry
(
$gong
);
//图片
$pic
[
'folder_id'
]
=
[
'eq'
,
$file_id
];
$pic_tiao
[
'a.folder_id'
]
=
[
'eq'
,
$file_id
];
$pic
=
$this
->
myfile
(
2
,
$pic
);
$zhuan_pic
=
$this
->
zhuan
(
2
,
$pic_tiao
);
$gong1
=
$this
->
gong
(
2
,
$pic
,
$zhuan_pic
);
$data
[
'pic'
]
=
$this
->
sundry
(
$gong1
);
//视频
$video
[
'folder_id'
]
=
[
'eq'
,
$file_id
];
$video_tiao
[
'a.folder_id'
]
=
[
'eq'
,
$file_id
];
$video
=
$this
->
myfile
(
3
,
$video
);
$zhuan_video
=
$this
->
zhuan
(
3
,
$video_tiao
);
$gong2
=
$this
->
gong
(
3
,
$video
,
$zhuan_video
);
$data
[
'video'
]
=
$this
->
sundry
(
$gong2
);
$text
=
Db
::
name
(
'official'
)
->
where
(
'id'
,
1
)
->
find
();
$data
[
'introduce'
]
=
$text
[
'introduce'
];
$this
->
assign
(
'data'
,
$data
);
$this
->
assign
(
'user_id'
,
$user_id
);
$this
->
assign
(
'file_id'
,
$file_id
);
return
$this
->
fetch
();
}
// 文件夹图片列表
public
function
image_detail
()
{
if
(
in_array
(
$this
->
browser
,[
1
,
2
]))
{
return
$this
->
fetch
(
'pilot'
);
}
$qiniu
=
get_addon_config
(
'qiniu'
)[
'cdnurl'
];
$user_id
=
$this
->
request
->
param
(
'user_id'
);
$file_id
=
$this
->
request
->
param
(
'file_id'
);
$info_res
=
Db
::
name
(
'folder'
)
->
where
(
'id'
,
$file_id
)
->
find
();
if
(
$info_res
[
'is_open'
]
==
2
){
$this
->
error
(
'该文件夹为私密,请在APP内打开'
);
}
//文件夹
$folder
=
Db
::
name
(
'folder'
)
->
where
(
'pid'
,
$file_id
)
->
where
(
'is_up'
,
1
)
->
select
();
foreach
(
$folder
as
&
$v
){
$v
[
'createtime'
]
=
date
(
'Y-m-d'
,
$v
[
'createtime'
]);
}
$times
=
array_values
(
array_unique
(
array_column
(
$folder
,
'createtime'
)));
//将数据放到对应的时间分段
$arrs
=
[];
foreach
(
$times
as
$t_k
=>
$t_v
){
$arrs
[
$t_k
][
'times'
]
=
$t_v
;
$k
=
0
;
foreach
(
$folder
as
$value
){
$k
+=
0
;
if
(
$t_v
==
$value
[
'createtime'
]){
$arrs
[
$t_k
][
'info'
][
$k
]
=
$value
;
$k
++
;
}
}
}
$data
[
'folder'
]
=
$arrs
;
//图片
$pic
[
'folder_id'
]
=
[
'eq'
,
$file_id
];
$pic_tiao
[
'a.folder_id'
]
=
[
'eq'
,
$file_id
];
$pic
=
$this
->
myfile
(
2
,
$pic
);
$zhuan_pic
=
$this
->
zhuan
(
2
,
$pic_tiao
);
$data
[
'pic'
]
=
$this
->
gong
(
2
,
$pic
,
$zhuan_pic
);
$text
=
Db
::
name
(
'official'
)
->
where
(
'id'
,
1
)
->
find
();
$data
[
'introduce'
]
=
$text
[
'introduce'
];
$this
->
assign
(
'data'
,
$data
);
return
$this
->
view
->
fetch
();
}
public
function
get_video_first_image
(
$video_url
,
$video_info
){
if
(
empty
(
$video_info
[
'streams'
][
0
][
'width'
]))
{
$width
=
$video_info
[
'streams'
][
1
][
'width'
];
$height
=
$video_info
[
'streams'
][
1
][
'height'
];
}
else
{
$width
=
$video_info
[
'streams'
][
0
][
'width'
];
$height
=
$video_info
[
'streams'
][
0
][
'height'
];
}
return
$video_url
.
'?vframe/jpg/offset/1/w/'
.
$width
.
'/h/'
.
$height
;
}
//通过传入类型获取我自己的不同文件
public
function
myfile
(
$type
,
$where
){
$data
=
Db
::
name
(
'savemes'
)
->
where
(
$where
)
->
where
(
'type'
,
$type
)
->
field
(
'id,user_id,type,name,share_url,images,video,content,is_open,is_up,createtime'
)
->
order
(
'createtime desc'
)
->
select
();
return
$data
;
}
//通过传入类型获取转存的不同文件
public
function
zhuan
(
$type
,
$tiao
){
$rotor
=
Db
::
name
(
'rotor'
)
->
alias
(
'a'
)
->
join
(
'savemes b'
,
'a.savemes_id = b.id'
)
->
field
(
'a.id,a.user_id as unloading_user_id,a.savemes_id,a.folder_id,b.user_id,b.share_url,b.name,b.type,b.images,b.video,b.content,b.is_open,b.is_up,a.createtime'
)
->
where
(
'b.type'
,
$type
)
->
where
(
$tiao
)
->
order
(
'a.createtime desc'
)
->
select
();
return
$rotor
;
}
//各种类型的文件 转存以及自己的文件
public
function
gong
(
$type
,
$arr1
,
$arr2
){
$qiniu
=
get_addon_config
(
'qiniu'
)[
'cdnurl'
];
if
(
!
empty
(
$arr2
)){
foreach
(
$arr2
as
&
$v_1
){
$v_1
[
'is_zhuan'
]
=
1
;
$v_1
[
'is_real'
]
=
2
;
}
$arr
=
array_merge
(
$arr1
,
$arr2
);
}
else
{
$arr
=
$arr1
;
}
//笔记类型
if
(
$type
==
1
){
foreach
(
$arr
as
&
$v
){
$v
[
'nowtime'
]
=
date
(
'Y-m-d'
,
$v
[
'createtime'
]);
$v
[
'createtime'
]
=
date
(
'm-d'
,
$v
[
'createtime'
]);
$v
[
'images'
]
=
''
;
$v
[
'video'
]
=
''
;
$v
[
'video_image'
]
=
''
;
}
}
elseif
(
$type
==
2
){
//图片类型
foreach
(
$arr
as
&
$v
){
$v
[
'nowtime'
]
=
date
(
'Y-m-d'
,
$v
[
'createtime'
]);
$v
[
'createtime'
]
=
date
(
'm-d'
,
$v
[
'createtime'
]);
$v
[
'images'
]
=
$qiniu
.
$v
[
'images'
];
$v
[
'video'
]
=
''
;
$v
[
'video_image'
]
=
''
;
$v
[
'content'
]
=
''
;
}
}
elseif
(
$type
==
3
){
//视频类型
foreach
(
$arr
as
&
$v
){
$v
[
'nowtime'
]
=
date
(
'Y-m-d'
,
$v
[
'createtime'
]);
$v
[
'createtime'
]
=
date
(
'm-d'
,
$v
[
'createtime'
]);
$v
[
'video'
]
=
$qiniu
.
$v
[
'video'
];
// 获取视频第一帧图片
$video_info
=
json_decode
(
file_get_contents
(
$v
[
'video'
]
.
'?avinfo'
),
true
);
$v
[
'video_image'
]
=
$this
->
get_video_first_image
(
$v
[
'video'
],
$video_info
);
$v
[
'images'
]
=
''
;
$v
[
'content'
]
=
''
;
}
}
return
$arr
;
}
//合并完数据按时间分段
public
function
sundry
(
$arr
){
$times
=
array_values
(
array_unique
(
array_column
(
$arr
,
'createtime'
)));
//将数据放到对应的时间分段
$arrs
=
[];
foreach
(
$times
as
$t_k
=>
$t_v
){
$arrs
[
$t_k
][
'times'
]
=
$t_v
;
$k
=
0
;
foreach
(
$arr
as
$value
){
$k
+=
0
;
if
(
$t_v
==
$value
[
'createtime'
]){
$arrs
[
$t_k
][
'info'
][
$k
]
=
$value
;
$k
++
;
}
}
}
return
$arrs
;
}
}
...
...
application/index/view/index/pilot.html
查看文件 @
0f1c5c0
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
分享详情
</title>
<link
rel=
"stylesheet"
href=
"/assets/cai/css/common.css"
>
<link
rel=
"stylesheet"
href=
"/assets/cai/css/file.css"
>
<style>
html
,
body
{
width
:
100%
;
margin
:
0
;
}
.browser_open
{
position
:
absolute
;
top
:
0
;
background
:
rgb
(
51
,
51
,
51
);
z-index
:
111
;
width
:
100%
;
height
:
100%
;
font-size
:
0
;
}
.browser_open
img
{
width
:
100%
;
font-size
:
0
;
}
</style>
</head>
<body>
<body>
<div
class=
"top"
>
彩云盘
</div>
<div
class=
"browser_open"
>
<img
src=
"__CDN__/assets/cai/image/browser.png"
/>
</div>
</body>
</html>
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论