From 0b55ac0050b2779383499c122182f82d0ce97f0f Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Fri, 11 Aug 2017 13:50:21 +0800
Subject: [PATCH] 提交素材及新闻详情页
---
application/modules/Admin/controllers/Index.php | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/application/modules/Admin/controllers/Index.php b/application/modules/Admin/controllers/Index.php
index 7e2b665..ea12b92 100644
--- a/application/modules/Admin/controllers/Index.php
+++ b/application/modules/Admin/controllers/Index.php
@@ -2,9 +2,47 @@
class IndexController extends System_Controller_Admin
{
+
+ public function init(){
+ parent::init();
+ }
+
public function indexAction()
{
- $this->_view->word= '123';
+ $daily_service = new Service_Daily();
+ $article_service = new Service_Article();
+ $user_id = $this->session['user']['user_id'];
+ $start_time = strtotime("-7 day");
+ $end_time = strtotime("-1 day");
+ $diff_days = ($end_time - $start_time) / 86400;
+ $total_days = $diff_days + 1;//���������������������
+ //$step = ($total_days - $total_days % 7) / 7;
+ $days_arr= array();
+ for($i = 0; $i < $total_days ; $i++){
+ $days_arr[] = date('Y-m-d', strtotime('+'.$i.' day', $start_time));
+ }
+ $user_dailys = $daily_service->getUserDataList($user_id, $days_arr);
+ $system_news = $article_service->getArticleList(array('category' => '1'), array(), array('create_time' => -1), 5);
+ $industry_news = $article_service->getArticleList(array('category' => '2'), array(), array('create_time' => -1), 5);
+ $ffs_news = $article_service->getArticleList(array('category' => '3'), array(), array('create_time' => -1), 5);
+ $my_news = $article_service->getArticleList(array('category' => '4'), array(), array('create_time' => -1), 5);
+ $this->getView()->assign(array('user_dailys' => $user_dailys, 'days_arr' => $days_arr, 'system_news' => $system_news, 'industry_news' => $industry_news, 'ffs_news' => $ffs_news, 'my_news' => $my_news));
+
}
+ /**
+ * ������������
+ * @param [type] $id [description]
+ */
+ public function LookAction($id){
+ $article_service = new Service_Article();
+ $article = $article_service->getArticleInfo(array('_id' => $id));
+ if($article){
+ $this->getView()->assign('article', $article);
+ }
+ else{
+ $this->redirect('/error/show/type/no_data');
+ }
+ }
+
}
--
Gitblit v1.8.0