public function down_collect()
 {
     if (!$this->is_login()) {
         $this->redirect("User/login");
     }
     $p = isset($_GET['p']) ? $_GET['p'] : 1;
     $listRow = 9;
     $ml = D('Article');
     $collectIds = array();
     foreach ($this->userInfo['collect'] as $collectV) {
         $collectIds[] = $collectV['article_id'];
     }
     $data = array();
     $data['id'] = array('in', $collectIds);
     $data['status'] = array('neq', 2);
     $list = $ml->relation(true)->where($data)->select();
     $listArr = array();
     foreach ($list as $listV) {
         foreach ($this->userInfo['collect'] as $collectVV) {
             if ($listV['id'] == $collectVV['article_id']) {
                 if ($listV['articleattributevalue']['sell_price'] < $collectVV['old_price']) {
                     $listArr[] = $listV;
                 }
             }
         }
     }
     $listDownCount = count($listArr);
     if (0 != $listDownCount) {
         $listArr = $this->getPriceList($listArr);
     }
     $listCount = '';
     if (null == $this->userInfo['collect']) {
         $listCount = 0;
     } else {
         $listCount = count($list);
     }
     $list = array();
     if (0 != $listDownCount) {
         for ($i = 0; $i < $listRow; $i++) {
             if (null != $listArr[($p - 1) * $listRow + $i]) {
                 $list[] = $listArr[($p - 1) * $listRow + $i];
             }
         }
     }
     $theme = array("up" => array("label" => "a", "class" => "btn", "text" => "上一页"), "numFirst" => array("label" => "a", "text" => "1"), "point" => array("label" => "span", "text" => "•••"), "normal" => array("label" => "a", "text" => ""), "cur" => array("label" => "a", "class" => "fy_bg", "text" => ""), "numEnd" => array("label" => "a", "text" => ""), "next" => array("label" => "a", "class" => "btn", "text" => "下一页"));
     import("@.Action.SuperPage");
     $pageUrl = U('User/my_collect') . '/p/{p}';
     $page = new SuperPage($pageUrl, $p, ceil($listDownCount / $listRow), 2, $theme);
     $pageStr = $page->show();
     $this->assign('pageStr', $pageStr);
     $this->assign('listDownCount', $listDownCount);
     $this->assign('listCount', $listCount);
     $this->assign('list', $list);
     $this->display();
 }
 public function search()
 {
     $urlArr = explode('/', __INFO__);
     if (4 > count($urlArr)) {
         $p = 1;
         $listRow = 12;
     } else {
         $urlPageAndRow = explode('-', $urlArr[3]);
         if ('' == $urlPageAndRow[1]) {
             $p = 1;
             $listRow = 12;
         } else {
             $p = $urlPageAndRow[0];
             $listRow = $urlPageAndRow[1];
         }
     }
     $search = '';
     if (isset($_POST['search'])) {
         $search = $_POST['search'];
     } else {
         $search = substr(strrchr(__INFO__, "/"), 1);
     }
     $ml = D('Article');
     $data['title'] = array("like", "%" . $search . "%");
     $pageData = $this->getPage($ml, $listRow, $p, $data, true);
     $theme = array("up" => array("label" => "a", "class" => "btn", "text" => "上一页"), "numFirst" => array("label" => "a", "text" => "1"), "point" => array("label" => "span", "text" => "•••"), "normal" => array("label" => "a", "text" => ""), "cur" => array("label" => "a", "class" => "cur", "text" => ""), "numEnd" => array("label" => "a", "text" => ""), "next" => array("label" => "a", "class" => "btn", "text" => "下一页"));
     import("@.Action.SuperPage");
     $pageUrl = U('Products/search') . '/{p}-' . $listRow . '/s/' . $search;
     $page = new SuperPage($pageUrl, $p, ceil($pageData['count'] / $listRow), 2, $theme);
     $pageStr = $page->show();
     $this->assign('pageStr', $pageStr);
     $mlCat = M('articlecategory');
     $leftCat = $this->getCat(7, $mlCat);
     $this->assign('search', $search);
     $this->assign('listRow', $listRow);
     $this->assign('leftCat', $leftCat);
     $this->assign('pageData', $pageData);
     $this->display();
 }