Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOOD
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
tmq
9 years ago
Commit
b2838fdad69abd5876ad420042748ebea1d19546
1 parent
8bd13cc0
分类
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
5 deletions
website/controller/Video.class.php
website/facade/News.class.php
website/service/News.class.php
website/view/script/news/index.php
website/controller/Video.class.php
View file @
b2838fd
...
...
@@ -10,7 +10,7 @@ class Controller_Video extends Controller_Abstract
$total
=
Facade_News
::
getTotal
(
$tag
);
$page
=
new
Lib_Helper_Pagination
(
$total
,
24
);
list
(
$offset
,
$limit
)
=
$page
->
getLimit
();
$list
=
Facade_News
::
getList
(
$tag
,
$offset
,
$limit
);
$list
=
Facade_News
::
get
Video
List
(
$tag
,
$offset
,
$limit
);
$this
->
_view
[
'pagination'
]
=
$page
->
getPagination
();
$this
->
_view
[
'list'
]
=
$list
;
}
...
...
website/facade/News.class.php
View file @
b2838fd
...
...
@@ -104,7 +104,20 @@ class Facade_News
*/
public
static
function
getList
(
$tag
,
$offset
,
$limit
,
$exceptTags
=
array
())
{
return
self
::
service
()
->
getList
(
$tag
,
$offset
,
$limit
,
$exceptTags
);
return
self
::
service
()
->
getList
(
$tag
,
$offset
,
$limit
,
$exceptTags
,
$type
=
0
);
}
/**
* 获取视频信息
*
* @param string $tag
* @param int $offset
* @param int $limit
* @param array $exceptTags
* @return array
*/
public
static
function
getVideoList
(
$tag
,
$offset
,
$limit
,
$exceptTags
=
array
())
{
return
self
::
service
()
->
getList
(
$tag
,
$offset
,
$limit
,
$exceptTags
,
$type
=
1
);
}
/**
...
...
website/service/News.class.php
View file @
b2838fd
...
...
@@ -77,7 +77,7 @@ class Service_News extends Lib_Service
* @param array $exceptTags
* @return array
*/
public
function
getList
(
$tag
,
$offset
,
$limit
,
$exceptTags
)
public
function
getList
(
$tag
,
$offset
,
$limit
,
$exceptTags
,
$type
)
{
$where
=
'1'
;
$exceptWhere
=
'1'
;
...
...
@@ -92,7 +92,11 @@ class Service_News extends Lib_Service
$tag
=
addslashes
(
$tag
);
$where
=
'`tag` like ("'
.
$tag
.
'%")'
;
}
$where
=
' WHERE '
.
$where
.
' or is_video=1 AND '
.
$exceptWhere
;
if
(
$type
==
1
)
{
$where
=
' WHERE '
.
$where
.
' or is_video=1 AND '
.
$exceptWhere
;
}
else
{
$where
=
' WHERE '
.
$where
.
' AND '
.
$exceptWhere
;
}
return
self
::
service
(
self
::
ROUTER
)
->
tag
(
self
::
$_tag
)
->
fetchAssoc
(
'getList'
,
array
(
'offset'
=>
intval
(
$offset
),
'limit'
=>
intval
(
$limit
)),
array
(
'where'
=>
$where
));
}
...
...
website/view/script/news/index.php
View file @
b2838fd
...
...
@@ -2,7 +2,7 @@
<?php
$this
->
_block
(
'main'
);
?>
<div
class=
"content-tab news-tab"
>
<ul
class=
"clearfix"
>
<?php
<?php
array_unshift
(
$this
->
view
->
tags
,
array
(
'tag'
=>
''
,
'num'
=>
$this
->
view
->
total
));
foreach
(
$this
->
view
->
tags
as
$tag
)
:
if
(
empty
(
$tag
[
'num'
]))
continue
;
...
...
Please
register
or
login
to post a comment