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
33f4959e
Commit
33f4959e
authored
Oct 27, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加视频观看完后提示
parent
b98e673c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Course.php
src/common/models/Course.php
+1
-1
HomeController.php
src/frontend/controllers/HomeController.php
+2
-2
No files found.
src/common/models/Course.php
View file @
33f4959e
...
@@ -171,7 +171,7 @@ class Course extends \yii\db\ActiveRecord
...
@@ -171,7 +171,7 @@ class Course extends \yii\db\ActiveRecord
if
(
$count
>
0
)
{
if
(
$count
>
0
)
{
$return
[
'data'
]
=
self
::
find
()
$return
[
'data'
]
=
self
::
find
()
->
select
(
'id,user_id,price,name,intro,preview_pic,recommend,status,play_count,comment_count,favorite_count,created_at,updated_at'
)
->
select
(
'id,user_id,price,name,intro,preview_pic,recommend,status,play_count,comment_count,favorite_count,created_at,updated_at'
)
->
where
(
$cond
)
->
orderBy
([
'id'
=>
SORT_DESC
])
->
limit
(
$num
)
->
offset
(
$offset
)
->
with
(
'teachers'
)
->
asArray
()
->
all
();
->
where
(
$cond
)
->
orderBy
([
'id'
=>
SORT_DESC
])
->
limit
(
$num
)
->
offset
(
$offset
)
->
with
(
'teachers'
)
->
with
(
'courseware'
)
->
asArray
()
->
all
();
}
}
return
$return
;
return
$return
;
...
...
src/frontend/controllers/HomeController.php
View file @
33f4959e
...
@@ -135,7 +135,7 @@ class HomeController extends \yii\web\Controller
...
@@ -135,7 +135,7 @@ class HomeController extends \yii\web\Controller
throw
new
HttpException
(
404
,
'页面不存在'
);
throw
new
HttpException
(
404
,
'页面不存在'
);
}
else
{
}
else
{
$coursewareInfo
=
$coursewareInfo
->
toArray
();
$coursewareInfo
=
$coursewareInfo
->
toArray
();
$coursewareInfo
[
'previewUrl'
]
=
Yii
::
$app
->
qiniu
->
getUrl
(
'public'
,
$course
->
preview_pic
);
$coursewareInfo
[
'previewUrl'
]
=
Yii
::
$app
->
qiniu
->
getUrl
(
'public'
,
$course
->
preview_pic
)
.
'-l.preview'
;
$coursewareInfo
[
'intro'
]
=
$course
->
intro
;
$coursewareInfo
[
'intro'
]
=
$course
->
intro
;
$coursewareInfo
[
'courseName'
]
=
$course
->
name
;
$coursewareInfo
[
'courseName'
]
=
$course
->
name
;
$coursewareInfo
[
'teachers'
]
=
ArrayHelper
::
toArray
(
$teachers
);
$coursewareInfo
[
'teachers'
]
=
ArrayHelper
::
toArray
(
$teachers
);
...
@@ -190,7 +190,7 @@ class HomeController extends \yii\web\Controller
...
@@ -190,7 +190,7 @@ class HomeController extends \yii\web\Controller
throw
new
HttpException
(
404
,
'页面不存在'
);
throw
new
HttpException
(
404
,
'页面不存在'
);
}
else
{
}
else
{
$coursewareInfo
=
$coursewareInfo
->
toArray
();
$coursewareInfo
=
$coursewareInfo
->
toArray
();
$coursewareInfo
[
'previewUrl'
]
=
Yii
::
$app
->
qiniu
->
getUrl
(
'public'
,
$course
->
preview_pic
);
$coursewareInfo
[
'previewUrl'
]
=
Yii
::
$app
->
qiniu
->
getUrl
(
'public'
,
$course
->
preview_pic
)
.
'-l.preview'
;
$coursewareInfo
[
'intro'
]
=
$course
->
intro
;
$coursewareInfo
[
'intro'
]
=
$course
->
intro
;
$coursewareInfo
[
'courseName'
]
=
$course
->
name
;
$coursewareInfo
[
'courseName'
]
=
$course
->
name
;
$coursewareInfo
[
'teachers'
]
=
ArrayHelper
::
toArray
(
$teachers
);
$coursewareInfo
[
'teachers'
]
=
ArrayHelper
::
toArray
(
$teachers
);
...
...
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