后台新闻管理仅列出本站新闻

This commit is contained in:
wlx 2014-06-11 02:56:12 +00:00
parent 2a73b322c6
commit d75be5b0c8
1 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ class Admin_NewsController extends Zend_Controller_Action
left join ".$News->tbl_catalog." ct on ct.aid=n.id left join ".$News->tbl_catalog." ct on ct.aid=n.id
left join ".$News->tbl_categorys." c on c.id = ct.cid left join ".$News->tbl_categorys." c on c.id = ct.cid
LEFT JOIN users u ON n.userid=u.id LEFT JOIN users u ON n.userid=u.id
WHERE c.id='$type' AND n.title IS NOT NULL order by n.ts_created desc"; WHERE c.id='$type' AND n.title IS NOT NULL and n.sub='$this->view->config->sub->news' order by n.ts_created desc";
}else }else
{ {
$sql = "select $sql = "select
@ -51,7 +51,7 @@ class Admin_NewsController extends Zend_Controller_Action
left join ".$News->tbl_catalog." ct on ct.aid=n.id left join ".$News->tbl_catalog." ct on ct.aid=n.id
left join ".$News->tbl_categorys." c on c.id = ct.cid left join ".$News->tbl_categorys." c on c.id = ct.cid
LEFT JOIN users u ON n.userid=u.id LEFT JOIN users u ON n.userid=u.id
WHERE n.title IS NOT NULL WHERE n.title IS NOT NULL and n.sub='$this->view->config->sub->news'
GROUP BY n.id GROUP BY n.id
ORDER BY n.ts_created desc ORDER BY n.ts_created desc
"; ";