Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
59fe3792
Commit
59fe3792
authored
Oct 27, 2016
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台课程列表显示可读的时长与文件大小等
parent
57769f93
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
16 deletions
+44
-16
index.php
src/backend/views/course/index.php
+6
-5
Utils.php
src/common/libs/Utils.php
+33
-0
index.php
src/frontend/views/my-course/index.php
+1
-3
index.php
src/frontend/views/my-income/index.php
+1
-3
index.php
src/frontend/views/my-member/index.php
+1
-3
index.php
src/frontend/views/teacher-manager/index.php
+2
-2
No files found.
src/backend/views/course/index.php
View file @
59fe3792
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
* @var $pagination \yii\data\Pagination
* @var $pagination \yii\data\Pagination
* @var $qiniu \common\components\Qiniu
* @var $qiniu \common\components\Qiniu
*/
*/
use
common\libs\Utils
;
use
common\models\Course
;
use
common\models\Course
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\helpers\Url
;
use
yii\helpers\Url
;
...
@@ -49,11 +50,11 @@ $qiniu = \Yii::$app->qiniu;
...
@@ -49,11 +50,11 @@ $qiniu = \Yii::$app->qiniu;
<tr
role=
"row"
>
<tr
role=
"row"
>
<th>
课程ID
</th>
<th>
课程ID
</th>
<th
colspan=
"2"
>
视频
</th>
<th
colspan=
"2"
>
视频
</th>
<th>
时长
/秒
</th>
<th>
时长
</th>
<th>
文件大小
</th>
<th>
文件大小
</th>
<th>
原始格式
</th>
<th>
原始格式
</th>
<th>
价格/元
</th>
<th>
价格/元
</th>
<th>
免费试看
/分钟
</th>
<th>
免费试看
</th>
<th>
ACTION
</th>
<th>
ACTION
</th>
</tr>
</tr>
</thead>
</thead>
...
@@ -63,11 +64,11 @@ $qiniu = \Yii::$app->qiniu;
...
@@ -63,11 +64,11 @@ $qiniu = \Yii::$app->qiniu;
<td
class=
"sorting_1"
>
<?=
$course
[
'id'
]
?>
</td>
<td
class=
"sorting_1"
>
<?=
$course
[
'id'
]
?>
</td>
<td
width=
"110"
><a
href=
"
<?=
$qiniu
->
getUrl
(
'public'
,
$course
[
'preview_pic'
])
?>
-m.preview"
target=
"_blank"
><img
src=
"
<?=
$qiniu
->
getUrl
(
'public'
,
$course
[
'preview_pic'
])
?>
-s.preview"
height=
"50"
></a></td>
<td
width=
"110"
><a
href=
"
<?=
$qiniu
->
getUrl
(
'public'
,
$course
[
'preview_pic'
])
?>
-m.preview"
target=
"_blank"
><img
src=
"
<?=
$qiniu
->
getUrl
(
'public'
,
$course
[
'preview_pic'
])
?>
-s.preview"
height=
"50"
></a></td>
<td><a
href=
"#"
>
<?=
Html
::
encode
(
$course
[
'name'
])
?>
</a><span
class=
"help-block"
>
<?=
date
(
'Y-m-d H:i:s'
,
$course
[
'created_at'
])
?>
</span></td>
<td><a
href=
"#"
>
<?=
Html
::
encode
(
$course
[
'name'
])
?>
</a><span
class=
"help-block"
>
<?=
date
(
'Y-m-d H:i:s'
,
$course
[
'created_at'
])
?>
</span></td>
<td>
<?=
$course
[
'courseware'
][
'time'
]
?>
</td>
<td>
<?=
Utils
::
humanSeconds
(
$course
[
'courseware'
][
'time'
])
?>
</td>
<td>
<?=
$course
[
'courseware'
][
'size'
]
?>
</td>
<td>
<?=
Utils
::
byteConvert
(
$course
[
'courseware'
][
'size'
])
?>
</td>
<td>
<?=
$course
[
'courseware'
][
'format'
]
?>
</td>
<td>
<?=
$course
[
'courseware'
][
'format'
]
?>
</td>
<td>
<?=
$course
[
'price'
]
?>
</td>
<td>
<?=
$course
[
'price'
]
?>
</td>
<td>
<?=
$course
[
'free_time'
]
?>
</td>
<td>
<?=
(
$course
[
'free_time'
]
?
$course
[
'free_time'
]
.
'分钟'
:
'-'
)
?>
</td>
<td>
<td>
<a
class=
"btn btn-info btn-xs COURSE_DETAIL"
href=
"
<?=
Url
::
to
([
'course/detail'
,
'id'
=>
$course
[
'id'
]])
?>
"
target=
"_blank"
><i
class=
"fa fa-info"
></i>
详情
</a>
<a
class=
"btn btn-info btn-xs COURSE_DETAIL"
href=
"
<?=
Url
::
to
([
'course/detail'
,
'id'
=>
$course
[
'id'
]])
?>
"
target=
"_blank"
><i
class=
"fa fa-info"
></i>
详情
</a>
<?php
if
(
$course
[
'status'
]
==
Course
::
STATUS_OK
)
{
?>
<?php
if
(
$course
[
'status'
]
==
Course
::
STATUS_OK
)
{
?>
...
...
src/common/libs/Utils.php
View file @
59fe3792
...
@@ -207,6 +207,39 @@ class Utils
...
@@ -207,6 +207,39 @@ class Utils
return
$count
;
return
$count
;
}
}
public
static
function
byteConvert
(
$bytes
)
{
if
(
$bytes
==
0
)
return
"0.00 B"
;
$s
=
array
(
'B'
,
'KB'
,
'MB'
,
'GB'
,
'TB'
,
'PB'
);
$e
=
floor
(
log
(
$bytes
,
1024
));
return
round
(
$bytes
/
pow
(
1024
,
$e
),
2
)
.
' '
.
$s
[
$e
];
}
/**
* 将秒数转换为自然时间
*
* @param int
* @return string
*/
public
static
function
humanSeconds
(
$tl
)
{
$units
=
[
'年'
=>
31536000
,
'月'
=>
2628000
,
'天'
=>
86400
,
'小时'
=>
3600
,
'分钟'
=>
60
,
'秒'
=>
1
];
$str
=
''
;
foreach
(
$units
as
$un
=>
$it
)
{
if
(
$tl
>=
$it
)
{
$floor
=
floor
(
$tl
/
$it
);
$tl
=
fmod
(
$tl
,
$it
);
$str
.=
$floor
.
$un
;
}
}
return
$str
;
}
/**
/**
* @param $rootElementName
* @param $rootElementName
* @param $ar
* @param $ar
...
...
src/frontend/views/my-course/index.php
View file @
59fe3792
...
@@ -112,7 +112,5 @@ $qiniu = \Yii::$app->qiniu;
...
@@ -112,7 +112,5 @@ $qiniu = \Yii::$app->qiniu;
<?=
LinkPager
::
widget
([
'pagination'
=>
$pagination
])
?>
<?=
LinkPager
::
widget
([
'pagination'
=>
$pagination
])
?>
</div>
</div>
<?php
}
else
{
?>
<?php
}
else
{
?>
<div
class=
"empty-data"
>
<div
class=
"empty-data"
>
您还没有添加课程!
</div>
您还没有添加课程!
</div>
<?php
}
?>
<?php
}
?>
\ No newline at end of file
src/frontend/views/my-income/index.php
View file @
59fe3792
...
@@ -72,7 +72,5 @@ AppAsset::addScript($this, '@web/assets/my_income.js');
...
@@ -72,7 +72,5 @@ AppAsset::addScript($this, '@web/assets/my_income.js');
</div>
</div>
</div>
</div>
<?php
}
else
{
?>
<?php
}
else
{
?>
<div
class=
"empty-data"
style=
"margin-top:80px;"
>
<div
class=
"empty-data"
style=
"margin-top:80px;"
>
您还没有卖出课程的记录!
</div>
您还没有卖出课程的记录!
</div>
<?php
}
?>
<?php
}
?>
\ No newline at end of file
src/frontend/views/my-member/index.php
View file @
59fe3792
...
@@ -62,7 +62,5 @@ $this->title = '我的会员';
...
@@ -62,7 +62,5 @@ $this->title = '我的会员';
</div>
</div>
</div>
</div>
<?php
}
else
{
?>
<?php
}
else
{
?>
<div
class=
"empty-data"
style=
"margin-top:80px;"
>
<div
class=
"empty-data"
style=
"margin-top:80px;"
>
您还没有会员!
</div>
您还没有会员!
</div>
<?php
}
?>
<?php
}
?>
\ No newline at end of file
src/frontend/views/teacher-manager/index.php
View file @
59fe3792
...
@@ -14,8 +14,8 @@ AppAsset::addScript($this, '@web/assets/teacher_manager.js');
...
@@ -14,8 +14,8 @@ AppAsset::addScript($this, '@web/assets/teacher_manager.js');
<img
src=
"
<?=
\common\models\User
::
getAvatarUrl
(
$row
[
'avatar'
])
?>
"
>
<img
src=
"
<?=
\common\models\User
::
getAvatarUrl
(
$row
[
'avatar'
])
?>
"
>
<h3>
<?=
$row
[
'name'
]
?>
</h3>
<h3>
<?=
$row
[
'name'
]
?>
</h3>
<p>
<?=
$row
[
'intro'
]
?>
</p>
<p>
<?=
$row
[
'intro'
]
?>
</p>
<a
class=
"edit"
href=
"
<?=
\yii\helpers\Url
::
to
([
'teacher-manager/edit'
,
'id'
=>
$row
[
'id'
]])
?>
"
><i
class=
"icon-mode_edit"
></i></a>
<a
class=
"edit"
href=
"
<?=
\yii\helpers\Url
::
to
([
'teacher-manager/edit'
,
'id'
=>
$row
[
'id'
]])
?>
"
title=
"编辑讲师信息"
><i
class=
"icon-mode_edit"
></i></a>
<a
href=
"javascript:;"
class=
"delete"
><i
class=
"icon-trash"
></i></a>
<a
href=
"javascript:;"
class=
"delete"
title=
"删除该讲师"
><i
class=
"icon-trash"
></i></a>
</div>
</div>
</div>
</div>
<?php
}
?>
<?php
}
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment