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
1e65a677
Commit
1e65a677
authored
Oct 27, 2016
by
汪波
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
bc7fcbbd
4b80a764
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
17 deletions
+49
-17
Course.php
src/common/models/Course.php
+1
-1
HomeController.php
src/frontend/controllers/HomeController.php
+2
-2
course-lists.vue
src/frontend/web/js/home/components/course-lists.vue
+10
-2
video-play.vue
src/frontend/web/js/home/components/video-play.vue
+1
-1
utils.js
src/frontend/web/js/libs/utils.js
+0
-11
utils.js
src/frontend/web/js/utils/utils.js
+35
-0
insert.sql
src/insert.sql
+0
-0
No files found.
src/common/models/Course.php
View file @
1e65a677
...
...
@@ -171,7 +171,7 @@ class Course extends \yii\db\ActiveRecord
if
(
$count
>
0
)
{
$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'
)
->
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
;
...
...
src/frontend/controllers/HomeController.php
View file @
1e65a677
...
...
@@ -135,7 +135,7 @@ class HomeController extends \yii\web\Controller
throw
new
HttpException
(
404
,
'页面不存在'
);
}
else
{
$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
[
'courseName'
]
=
$course
->
name
;
$coursewareInfo
[
'teachers'
]
=
ArrayHelper
::
toArray
(
$teachers
);
...
...
@@ -190,7 +190,7 @@ class HomeController extends \yii\web\Controller
throw
new
HttpException
(
404
,
'页面不存在'
);
}
else
{
$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
[
'courseName'
]
=
$course
->
name
;
$coursewareInfo
[
'teachers'
]
=
ArrayHelper
::
toArray
(
$teachers
);
...
...
src/frontend/web/js/home/components/course-lists.vue
View file @
1e65a677
...
...
@@ -17,8 +17,8 @@
</div>
<div
class=
"v-teacher-list clearfix"
>
<span
class=
"pull-left"
>
发布时间:
2016-08-04
</span>
<span
class=
"pull-right"
>
时长:
01:28:21
</span>
<span
class=
"pull-left"
>
发布时间:
{{
transcateTimeUnSecs
(
item
.
updated_at
)
}}
</span>
<span
class=
"pull-right"
>
时长:
{{
transcateSeconds
(
item
.
courseware
.
time
)
}}
</span>
</div>
<div
class=
"v-foot"
>
...
...
@@ -41,6 +41,7 @@
</
template
>
<
script
>
import
moment
from
'moment'
;
import
Utils
from
'../../utils/utils'
;
export
default
{
data
(){
return
{
...
...
@@ -64,9 +65,16 @@
{
window
.
location
.
href
=
__BASE_URL__
+
'home/video?courseId='
+
id
;
},
transcateSeconds
(
sec
){
return
Utils
.
secondsToHms
(
sec
);
},
transcateTime
(
time
)
{
return
moment
(
new
Date
(
time
*
1000
)).
format
(
'YYYY-MM-DD HH:mm:ss'
);
},
transcateTimeUnSecs
(
time
)
{
return
moment
(
new
Date
(
time
*
1000
)).
format
(
'YYYY-MM-DD HH:mm'
);
}
,
getFullPreViewPic
(
pic
)
...
...
src/frontend/web/js/home/components/video-play.vue
View file @
1e65a677
...
...
@@ -126,7 +126,7 @@
</div>
</template>
<script>
import Utils from '../../
lib
s/utils';
import Utils from '../../
util
s/utils';
import myvideo from './video.vue';
export default{
data(){
...
...
src/frontend/web/js/libs/utils.js
deleted
100644 → 0
View file @
bc7fcbbd
/**
* Created by xiabin on 2016/10/19.
*/
var
Utils
=
{
isWeixin
:
function
()
{
var
ua
=
navigator
.
userAgent
.
toLowerCase
();
return
ua
.
indexOf
(
'micromessenger'
)
!=
-
1
;
}
};
module
.
exports
=
Utils
;
\ No newline at end of file
src/frontend/web/js/utils/utils.js
0 → 100644
View file @
1e65a677
/**
* Created by xiabin on 2016/10/19.
*/
var
Utils
=
{
isWeixin
:
function
()
{
var
ua
=
navigator
.
userAgent
.
toLowerCase
();
return
ua
.
indexOf
(
'micromessenger'
)
!=
-
1
;
},
pad
:
function
(
num
,
size
)
{
var
s
=
num
+
""
;
while
(
s
.
length
<
size
)
s
=
"0"
+
s
;
return
s
;
},
secondsToHms
(
seconds
){
var
hour
=
Math
.
floor
(
seconds
/
3600
);
var
min
=
Math
.
floor
(
seconds
/
60
);
var
sec
=
Math
.
floor
(
seconds
%
60
);
var
result
=
[];
if
(
hour
>
0
){
result
.
push
(
this
.
pad
(
hour
,
2
));
result
.
push
(
this
.
pad
(
min
,
2
));
result
.
push
(
this
.
pad
(
sec
,
2
));
}
else
if
(
min
>
0
){
result
.
push
(
this
.
pad
(
min
,
2
));
result
.
push
(
this
.
pad
(
sec
,
2
));
}
else
{
result
.
push
(
this
.
pad
(
sec
,
2
));
}
return
result
.
join
(
':'
);
}
};
module
.
exports
=
Utils
;
\ No newline at end of file
src/insert.sql
0 → 100644
View file @
1e65a677
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