Ejemplo n.º 1
0
 public function actionIndex()
 {
     $this->pageTitle = Yii::app()->name . '-经销商店铺';
     $dealerid = Yii::app()->request->getParam('dealerid');
     $model = Organ::model()->findByPk($dealerid, "Identity=2");
     if (!$model) {
         $this->redirect(array('/pap/home/index'));
     }
     if (!isset($dealerid) || empty($dealerid)) {
         throw new CHttpException(404, 'Invalid request. Please do not repeat this request again.');
     }
     $orderGet = Yii::app()->request->getParam('order');
     $brandGet = Yii::app()->request->getParam('brand');
     $priceGet = Yii::app()->request->getParam('price');
     $skwd1 = urldecode(Yii::app()->request->getParam('skwd'));
     $skwd = MallService::checkKey($skwd1);
     $sub = Yii::app()->request->getParam('sub');
     $ispro = Yii::app()->request->getParam('ispro');
     $partslevel = Yii::app()->request->getParam('partslevel');
     //车型车系
     $cookie = Yii::app()->request->getCookies();
     //var_dump($cookie);
     $car['make'] = $cookie['mallmake']->value;
     $car['series'] = $cookie['mallseries']->value;
     $car['year'] = $cookie['mallyear']->value;
     $car['model'] = $cookie['mallmodel']->value;
     //获取商品品牌
     $brandparams['dealerid'] = $dealerid;
     $brandparams['type'] = 2;
     $brandparams['brand'] = $brandGet;
     $brandparams['sub'] = $sub;
     $brandparams['skwd'] = $skwd;
     $brandparams['car'] = $car;
     $brandModel = MallService::getDealerbrand($brandparams);
     //$brandModel = MallService::getBrand($brandparams);
     $brandData = $brandModel['data'];
     $brand = $brandModel['brand'];
     //价格区间
     $priceModel = MallService::getPrice(array('price' => $priceGet));
     $priceData = $priceModel['data'];
     $price = $priceModel['price'];
     //获得排序
     $orderData = $this->getOrder($orderGet);
     //获取url
     $get = $this->getSearchParams($_GET);
     $params = array('order' => $orderData[0], 'dealerid' => $dealerid, 'skwd' => $skwd, 'brand' => $brandGet, 'price' => $price['cond'], 'car' => $car, 'sub' => $sub, 'ispro' => $ispro, 'rows' => 12, 'resource' => "mall", 'partslevel' => $partslevel, 'type' => 3, 'organID' => Yii::app()->user->getOrganID());
     //获取适用车型text
     //$carmodeltxt = MallService::getCarmodeltxt($car);
     //经销商店铺信息
     $seller = DefaultService::sellerstore($dealerid);
     //店铺积分
     $TotalScore = DefaultService::getrecord($dealerid);
     //获取大类名称
     if ($sub) {
         $big = Gcategory::model()->findByPk($sub);
     }
     //获取商品
     $goods = MallService::getGoodsData($params);
     $rows = $this->Getmaincate($dealerid);
     $cate = $this->findsub($rows);
     // var_dump($cate);exit;
     //底部分页
     //推荐商品
     //获取经销商客服列表
     $csparams['organID'] = $dealerid;
     $csparams['type'] = 1;
     $csinfo = CsService::getcslists($csparams);
     $data = array('seller' => $seller, 'csinfo' => $csinfo, 'TotalScore' => $TotalScore, 'dataProvider' => $goods['dataProvider'], 'pages' => $this->getShortPage($goods["count"], $params['rows']), 'dealerID' => $dealerid, 'order' => $orderData, 'get' => $get, 'cate' => $cate, 'displayType' => MallService::getDisplayType("seller_displayType"), 'params' => array('brand' => $brand, 'price' => $price, 'ispro' => $ispro, 'partslevel' => $partslevel), 'brand' => $brandData, 'price' => $priceData, 'order' => $orderData, 'bigid' => $big['ParentID']);
     $this->render('index', $data);
 }