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
d4bcef79
Commit
d4bcef79
authored
Oct 26, 2016
by
汪波
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
4d28d8ff
066dc72f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
22 deletions
+59
-22
Course.php
src/common/models/Course.php
+1
-1
index.php
src/frontend/views/my-course/index.php
+58
-21
No files found.
src/common/models/Course.php
View file @
d4bcef79
...
...
@@ -169,7 +169,7 @@ class Course extends \yii\db\ActiveRecord
if
(
$count
>
0
)
{
$return
[
'data'
]
=
self
::
find
()
->
select
(
'id,user_id,price,name,intro,preview_pic,recommend,
play_count,comment_count,favorite_count,cre
ated_at'
)
->
select
(
'id,user_id,price,name,intro,preview_pic,recommend,
status,play_count,comment_count,favorite_count,created_at,upd
ated_at'
)
->
where
(
$cond
)
->
orderBy
([
'id'
=>
SORT_DESC
])
->
limit
(
$num
)
->
offset
(
$offset
)
->
with
(
'teachers'
)
->
asArray
()
->
all
();
}
...
...
src/frontend/views/my-course/index.php
View file @
d4bcef79
...
...
@@ -17,32 +17,70 @@ $qiniu = \Yii::$app->qiniu;
?>
<div
class=
"cls-list-box clearfix"
>
<?php
foreach
(
$list
as
$course
)
{
?>
<div
class=
"col-md-4"
>
<div
class=
"cls-box-main"
>
<div
class=
"video-img-box"
>
<a
href=
"
<?=
Course
::
url
(
$course
[
'id'
])
?>
"
target=
"_blank"
><img
src=
"
<?=
$qiniu
->
getUrl
(
'public'
,
$course
[
'preview_pic'
])
?>
-m.preview"
></a>
<div
class=
"video-list-cnt"
>
<div
class=
"tit"
><a
href=
"
<?=
Course
::
url
(
$course
[
'id'
])
?>
"
target=
"_blank"
>
<?=
$course
[
'name'
]
?>
</a></div>
<div
class=
"col-md-4"
>
<div
class=
"cls-box-main"
>
<div
class=
"video-img-box"
>
<?php
if
(
$course
[
'status'
]
==
'3'
)
:
?>
<a
href=
"javascript:;"
target=
"_blank"
><img
src=
"
<?=
$qiniu
->
getUrl
(
'public'
,
$course
[
'preview_pic'
])
?>
-m.preview"
></a>
<?php
elseif
(
$course
[
'status'
]
==
'1'
)
:
?>
<a
href=
"
<?=
Course
::
url
(
$course
[
'id'
])
?>
"
target=
"_blank"
><img
src=
"
<?=
$qiniu
->
getUrl
(
'public'
,
$course
[
'preview_pic'
])
?>
-m.preview"
></a>
<?php
elseif
(
$course
[
'status'
]
==
'2'
||
$course
[
'status'
]
==
'0'
)
:
?>
<a
href=
"javascript:;"
target=
"_blank"
><img
src=
"
<?=
$qiniu
->
getUrl
(
'public'
,
$course
[
'preview_pic'
])
?>
-m.preview"
></a>
<?php
endif
;
?>
<div
class=
"video-list-cnt"
>
<div
class=
"teacher"
>
<?php
if
(
$course
[
'teachers'
])
{
?>
讲师:
<?=
join
(
', '
,
array_column
(
$course
[
'teachers'
],
'name'
))
?><?php
}
?>
</div>
<?php
if
(
$course
[
'status'
]
==
'3'
)
:
?>
<div
class=
"tit"
><a
href=
"javascript:;"
target=
"_blank"
>
<?=
$course
[
'name'
]
?>
</a></div>
<?php
elseif
(
$course
[
'status'
]
==
'1'
)
:
?>
<div
class=
"tit"
><a
href=
"
<?=
Course
::
url
(
$course
[
'id'
])
?>
"
target=
"_blank"
>
<?=
$course
[
'name'
]
?>
</a></div>
<?php
elseif
(
$course
[
'status'
]
==
'2'
||
$course
[
'status'
]
==
'0'
)
:
?>
<div
class=
"tit"
><a
href=
"javascript:;"
target=
"_blank"
>
<?=
$course
[
'name'
]
?>
</a></div>
<?php
endif
;
?>
<div
class=
"description"
>
<?=
mb_substr
(
strip_tags
(
$course
[
'intro'
]),
0
,
250
)
?>
</div>
<div
class=
"teacher"
><span>
<?=
$course
[
'play_count'
]
?>
次播放
</span>
·
<span>
<?=
$course
[
'comment_count'
]
?>
次评论
</span>
·
<span>
<?=
$course
[
'favorite_count'
]
?>
收藏
</span></div>
</div>
<div
class=
"edit"
><a
href=
"
<?=
Url
::
to
([
'my-course/edit'
,
'id'
=>
$course
[
'id'
]])
?>
"
title=
"编辑课程信息"
><i
class=
"icon-mode_edit"
></i></a></div>
<div
class=
"teacher"
>
<?php
if
(
$course
[
'teachers'
])
{
?>
讲师:
<?=
join
(
', '
,
array_column
(
$course
[
'teachers'
],
'name'
))
?><?php
}
?>
</div>
<div
class=
"description"
>
<?=
mb_substr
(
strip_tags
(
$course
[
'intro'
]),
0
,
250
)
?>
</div>
<?php
if
(
$course
[
'status'
]
==
'1'
or
$course
[
'status'
]
==
'3'
)
:
?>
<div
class=
"teacher"
><span>
<?=
$course
[
'play_count'
]
?>
次播放
</span>
·
<span>
<?=
$course
[
'comment_count'
]
?>
次评论
</span>
·
<span>
<?=
$course
[
'favorite_count'
]
?>
收藏
</span></div>
<?php
endif
;
?>
<?php
if
(
$course
[
'status'
]
==
'0'
)
:
?>
<div
class=
"teacher"
>
提交时间:
<?=
date
(
'Y-m-d H:i:s'
,
$course
[
'updated_at'
])
?>
</div>
<?php
endif
;
?>
</div>
<?php
if
(
$course
[
'recommend'
]
==
'1'
)
:
?>
<span
class=
"video-examine-icon"
>
荐
</span>
<?php
endif
;
?>
<?php
if
(
$course
[
'status'
]
==
'0'
or
$course
[
'status'
]
==
'2'
)
:
?>
<span
class=
"video-examine-icon"
>
审
</span>
<?php
endif
;
?>
<?php
if
(
$course
[
'status'
]
!=
'3'
)
:
?>
<div
class=
"edit"
><a
href=
"
<?=
Url
::
to
([
'my-course/edit'
,
'id'
=>
$course
[
'id'
]])
?>
"
title=
"编辑课程信息"
><i
class=
"icon-mode_edit"
></i></a></div>
<?php
endif
;
?>
</div>
</div>
</div>
</div>
<?php
}
?>
<div
class=
"col-md-4"
>
<div
class=
"cls-box-main"
>
<div
class=
"video-img-box"
>
<a
href=
"#"
target=
"_blank"
><img
src=
"http://dev.qdn.pp.cc/preview/f0/97/a3/f8s68SyefrZj3841.jpg-m.preview"
></a>
<a
href=
"#"
target=
"_blank"
><img
src=
"http://dev.qdn.pp.cc/preview/f0/97/a3/f8s68SyefrZj3841.jpg-m.preview"
></a>
<div
class=
"video-list-cnt"
>
<div
class=
"tit"
><a
href=
"#"
target=
"_blank"
>
课程名称
</a></div>
<div
class=
"teacher"
>
讲师:万达
</div>
...
...
@@ -50,23 +88,22 @@ $qiniu = \Yii::$app->qiniu;
<div
class=
"teacher"
>
提交时间:2016-12-09 18:09
</div>
</div>
<!--<span class="video-examine-icon">审</span>-->
<span
class=
"video-examine-icon"
>
荐
</span>
<div
class=
"edit"
><a
href=
"
<?=
Url
::
to
([
'my-course/edit'
,
'id'
=>
$course
[
'id'
]])
?>
"
title=
"编辑课程信息"
><i
class=
"icon-mode_edit"
></i></a></div>
<div
class=
"edit"
><a
href=
"
<?=
Url
::
to
([
'my-course/edit'
,
'id'
=>
$course
[
'id'
]])
?>
"
title=
"编辑课程信息"
><i
class=
"icon-mode_edit"
></i></a></div>
</div>
</div>
</div>
</div>
<div
class=
"text-center"
>
<?=
LinkPager
::
widget
([
'pagination'
=>
$pagination
])
?>
<?=
LinkPager
::
widget
([
'pagination'
=>
$pagination
])
?>
</div>
<script
type=
'text/javascript'
>
$
(
function
()
{
turmbw
=
$
(
'.video-img-box img'
).
width
();
turmbh
=
turmbw
*
5
/
9
;
$
(
'.video-img-box img'
).
css
(
'height'
,
turmbh
);
turmbh
=
turmbw
*
5
/
9
;
$
(
'.video-img-box img'
).
css
(
'height'
,
turmbh
);
})
</script>
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