Exemplo n.º 1
0
 public static function papgetgoods($param = array())
 {
     $car['make'] = Yii::app()->request->getParam('make') ? Yii::app()->request->getParam('make') : Yii::app()->request->getParam('jpmall_make');
     $car['series'] = Yii::app()->request->getParam('series') ? Yii::app()->request->getParam('series') : Yii::app()->request->getParam('jpmall_series');
     $car['year'] = Yii::app()->request->getParam('year') ? Yii::app()->request->getParam('year') : Yii::app()->request->getParam('jpmall_year');
     $car['model'] = Yii::app()->request->getParam('model') ? Yii::app()->request->getParam('model') : Yii::app()->request->getParam('jpmall_model');
     $params = array('rows' => 12, 'page' => Yii::app()->request->getParam("page") ? Yii::app()->request->getParam("page") : 1, 'car' => $car, 'SellerID' => Yii::app()->user->getOrganID());
     if ($param['IsPro'] == 2) {
         //促销
         $params['SellerIsPro'] = 2;
     }
     if ($param['IsPro'] == 5) {
         //未促销
         $params['SellerIsPro'] = 22;
     }
     if ($_GET) {
         $Title = Yii::app()->request->getParam('Title');
         if ($Title && $Title != '请输入关键字') {
             $Title = urldecode($Title);
             $params['keywords'] = $Title;
         }
         $GoodsNO = Yii::app()->request->getParam('GoodsNO');
         if ($GoodsNO) {
             $GoodsNO = urldecode($GoodsNO);
             $params['GoodsNO'] = $GoodsNO;
         }
         $Name = Yii::app()->request->getParam('Name');
         if ($Name) {
             $Name = urldecode($Name);
             $params['Name'] = $Name;
         }
         $BrandID = Yii::app()->request->getParam('BrandID');
         if ($BrandID) {
             $params['brandID'] = $BrandID;
         }
         $StandCode = Yii::app()->request->getParam('StandCode');
         if ($StandCode) {
             $params['codes'] = $StandCode;
         }
         $Pinyin = Yii::app()->request->getParam('Pinyin');
         if ($Pinyin) {
             $Pinyin = urldecode($Pinyin);
             $params['Pinyin'] = $Pinyin;
         }
         $PartsLevel = Yii::app()->request->getParam('PartsLevel');
         if ($PartsLevel) {
             $params['PartsLevel'] = $PartsLevel;
         }
         $Price = Yii::app()->request->getParam('Price');
         if ($Price) {
             $Price = urldecode($Price);
             $params['goodprice'] = $Price;
         }
         $OE = Yii::app()->request->getParam('OE');
         if ($OE) {
             $OE = urldecode($OE);
             $params['oeno'] = $OE;
         }
         $IsSale = Yii::app()->request->getParam('IsSale');
         if ($IsSale == 1) {
             $params['IsSale'] = 1;
         } else {
             if ($IsSale == 0) {
                 $params['IsSale'] = 0;
             }
         }
     }
     //        exit;
     foreach ($params as $key => $value) {
         $params[$key] = str_replace('%', '\\%', $params[$key]);
         $params[$key] = str_replace('<<q>>', '/', $params[$key]);
     }
     $params['order'] = 'time_l';
     $model = MallService::getGoodsDataold($params);
     $car = MallService::getCarmodeltxt($params);
     return array('model' => $model, 'car' => $car);
 }