예제 #1
0
 public function actionIssale()
 {
     $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
     $pageSize = 10;
     $manufacturer_id = Yii::app()->user->id;
     if (isset($_GET['submit'])) {
         $params = $_GET['search'];
         //搜索查询字段接收
         $result = Goods::GetGoodsBySelf($manufacturer_id, $page, $pageSize, $params, true);
     } else {
         $result = Goods::GetGoodsBySelf($manufacturer_id, $page, $pageSize, "", true);
     }
     //搜索中的适用品牌
     $brand = $this->getbrand(0);
     //类别
     $category = $this->getcategory();
     $stand = $this->GetStand();
     //调用配件品类
     $stand = $this->GetStand();
     $this->render('issale', array('result' => $result[0], 'pages' => $result[1], 'brand' => $brand, 'category' => $category, 'parts' => $stand));
 }
예제 #2
0
 /**
  * 查看授权商品
  */
 public function actionShouqgoods()
 {
     $makerID = $_GET['maker_id'];
     $userid = Yii::app()->user->id;
     //{$_GET['dealer']}
     //$result =  Goods::GetGoodsByMakeID($makerID);
     $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
     //		$criteria=new CDbCriteria();
     //$sql = Goods::GetGoodsBySql($makerID,$userid);
     //		if(isset($_GET['submit']))
     //		{
     //			$search=$_GET['search'];
     //			$search=array_filter($search);
     //			$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
     //			//搜索查询字段接收
     //			$radionum=isset($_GET['search']['num'])?trim($_GET['search']['num']):'';
     //			$oenum=isset($_GET['search']['oenum'])?trim($_GET['search']['oenum']):'';
     //			$category=isset($_GET['search']['category'])?trim($_GET['search']['category']):'';
     //			$cpname=isset($_GET['search']['cpname'])?trim($_GET['search']['cpname']):'';
     //			$goodsname=isset($_GET['search']['name'])?trim($_GET['search']['name']):'';
     //
     //			if(!empty($goodsname))//商品名称搜索
     //			{
     //				$sql.=" and b.name like'%$goodsname%'";
     //			}if(!empty($oenum))//OE号搜索
     //			{
     //				$sql.=" and a.oe like '%$oenum%'";
     //			}if(!empty($radionum))//商品编号搜索
     //			{
     //				$sql.=" and b.goodsno like '%$radionum%'";
     //			}if(!empty($category)&& $category !='商品类别')//商品类别搜索
     //			{
     //				$sql.=" and c.name='$category'";
     //			}if(!empty($cpname))//标准名称搜索
     //			{
     //				$sql.=" and e.cp_name like '%$cpname%'";
     //			}
     //		}
     //		$sql.=" group by a.id order by a.id desc";
     //		$results=Yii::app()->db->createCommand($sql)->queryAll();
     //		$count=count($results);
     //		$pages=new CPagination($count);
     //		//设置分页页数
     //		$pages->pageSize=10;
     //		$pages->applyLimit($criteria);
     //		$results=Yii::app()->db->createCommand($sql." LIMIT :offset,:limit");
     //		//绑定分页参数
     //		$results->bindValue(':offset', $pages->currentPage*$pages->pageSize);
     //		$results->bindValue(':limit', $pages->pageSize);
     //		$results=$results->queryAll();
     if (isset($_GET['submit'])) {
         $search = $_GET['search'];
         $search1 = array('oenum' => $search['oenum'], 'category' => $search['category'], 'cpname' => $search['cpname'], 'name' => $search['name'], 'num' => $search['num']);
         $results = Goods::GetGoodsBySelf($makerID, $page, 10, $search1, null);
     } else {
         $results = Goods::GetGoodsBySelf($makerID, $page, 10, null, null);
     }
     //var_dump($results[0]);exit;
     //类别
     $category = $this->getcategory();
     //echo $sql2;
     //$cond = " group by a.id order by a.id desc  ";
     //$result = DBUtil::queryAll($sql2.$cond);
     //var_dump($result);
     $this->render('shouqgoods', array('models' => $results[0], 'pages' => $results[1], 'category' => $category, 'search' => $search));
 }