Ejemplo n.º 1
0
 /**
  * Show sales stats
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $stats = new StatsClass();
     // Top articles
     $this->articles = $stats->getTopSalesArticles($this->period);
     //
     $this->categories = $stats->getTopSalesCategories($this->period);
 }
Ejemplo n.º 2
0
 public function executeShow(sfWebRequest $request)
 {
     $this->categories = Doctrine_Core::getTable('Category')->getMainPageList();
     $this->currentCategory = $this->getRoute()->getObject();
     $this->forward404Unless($this->getRoute()->getObject()->getCategoryArticlesList());
     $u_user_id = 0;
     if ($this->getUser()->isAuthenticated()) {
         if ($this->getUser()->getGuardUser()->getUtype() == 'uuser') {
             $u_user_id = $this->getUser()->getGuardUser()->getId();
             // Update stats
             StatsClass::uuserViewCategory($u_user_id, $this->currentCategory->getId());
         }
     }
     $this->pager = new sfDoctrinePager('Category', sfConfig::get('app_category_max_articles'));
     $this->pager->setQuery($this->getRoute()->getObject()->getCategoryArticlesListQuery($u_user_id));
     $this->pager->setPage($request->getParameter('page', 1));
     $this->pager->init();
 }