当前位置: 首页>>代码示例>>PHP>>正文


PHP Helper::getViewId方法代码示例

本文整理汇总了PHP中Helper::getViewId方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::getViewId方法的具体用法?PHP Helper::getViewId怎么用?PHP Helper::getViewId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Helper的用法示例。


在下文中一共展示了Helper::getViewId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getProductReviews

 public function getProductReviews($productid)
 {
     $sql = "SELECT\n\t\t\t\t\treview,\n\t\t\t\t\tnick,\n\t\t\t\t\tadddate,\n\t\t\t\t\tidproductreview\n\t\t\t\tFROM productreview\n\t\t\t\tWHERE productid = :productid AND viewid = :viewid AND enable = 1\n\t\t\t\tGROUP BY idproductreview\n\t\t\t\tORDER BY adddate ASC\n\t\t";
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('productid', $productid);
     $stmt->bindValue('viewid', Helper::getViewId());
     $Data = array();
     try {
         $stmt->execute();
         while ($rs = $stmt->fetch()) {
             $sql2 = "SELECT \n\t\t\t\t\t\t\tPR.rangetypeid,\n\t\t\t\t\t\t\tPR.value,\n\t\t\t\t\t\t\tRTT.name\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tproductrange PR\n\t\t\t\t\t\t\tLEFT JOIN rangetypetranslation RTT ON RTT.rangetypeid = PR.rangetypeid AND RTT.languageid = :languageid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tPR.productreviewid = :reviewid";
             $stmt2 = Db::getInstance()->prepare($sql2);
             $stmt2->bindValue('reviewid', $rs['idproductreview']);
             $stmt2->bindValue('languageid', Helper::getLanguageId());
             $rangesRes = $stmt2->execute();
             $ranges = array();
             while ($rangesRes = $stmt2->fetch()) {
                 $ranges[] = array('rangetypeid' => $rangesRes['rangetypeid'], 'value' => $rangesRes['value'], 'name' => $rangesRes['name']);
             }
             $Data[] = array('nick' => $rs['nick'], 'review' => $rs['review'], 'adddate' => $rs['adddate'], 'ranges' => $ranges);
         }
     } catch (Exception $e) {
         throw new FrontendException('Error while doing sql query- getProductReviews (productreview)');
     }
     return $Data;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:26,代码来源:productreview.php

示例2: getCategories

    public function getCategories($params)
    {
        $sql = 'SELECT
					PC.categoryid AS id,
					CT.name AS caption,
					CT.seo
				FROM productcategory PC
				LEFT JOIN product P ON PC.productid = P.idproduct
				LEFT JOIN categorytranslation CT ON PC.categoryid = CT.categoryid AND CT.languageid = :languageid
				LEFT JOIN viewcategory VC ON PC.categoryid = VC.categoryid
				LEFT JOIN productstatuses PS ON PC.productid = PS.productid
				WHERE VC.viewid = :viewid AND PS.productstatusid = :statusid AND P.enable = 1
				GROUP BY PC.categoryid';
        $stmt = Db::getInstance()->prepare($sql);
        $stmt->bindValue('languageid', Helper::getLanguageId());
        $stmt->bindValue('viewid', Helper::getViewId());
        $stmt->bindValue('statusid', $params['statusId']);
        $stmt->execute();
        $Data = array();
        $Data[] = array('id' => 0, 'caption' => _('TXT_ALL'));
        while ($rs = $stmt->fetch()) {
            $Data[] = array('id' => $rs['id'], 'caption' => $rs['caption'], 'link' => $this->registry->router->generate('frontend.categorylist', true, array('param' => $rs['seo'])));
        }
        return $Data;
    }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:25,代码来源:showcasebox.php

示例3: getProducerAll

    public function getProducerAll()
    {
        $sql = 'SELECT 
					P.idproducer AS id,
					PT.name,
					PT.seo, 
					P.photoid, 
					COUNT(PROD.idproduct) AS totalproducts
				FROM producer P
				LEFT JOIN producertranslation PT ON PT.producerid = P.idproducer AND PT.languageid = :language
				LEFT JOIN producerview PV ON P.idproducer = PV.producerid
				LEFT JOIN product PROD ON PROD.producerid = P.idproducer AND PROD.enable = 1
				WHERE PV.viewid = :viewid
				GROUP BY P.idproducer
				HAVING totalproducts > 0
				ORDER BY PT.name ASC';
        $Data = array();
        $stmt = Db::getInstance()->prepare($sql);
        $stmt->bindValue('language', Helper::getLanguageId());
        $stmt->bindValue('viewid', Helper::getViewId());
        $stmt->execute();
        while ($rs = $stmt->fetch()) {
            $Data[] = array('id' => $rs['id'], 'name' => $rs['name'], 'seo' => $rs['seo'], 'link' => $this->registry->router->generate('frontend.producerlist', true, array('param' => $rs['seo'])), 'active' => $this->getParam() == $rs['seo'] ? true : false, 'photo' => App::getModel('categorylist')->getImagePath($rs['photoid']));
        }
        return $Data;
    }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:26,代码来源:producerbox.php

示例4: getCategories

    protected function getCategories()
    {
        $sql = '
				SELECT
					C.idcategory AS id,
					CT.name AS label
				FROM
					category C
					INNER JOIN viewcategory CV ON CV.categoryid = idcategory
					LEFT JOIN categorytranslation CT ON C.idcategory = CT.categoryid AND CT.languageid = :languageid
				WHERE
					CV.viewid = :viewid AND C.enable = 1
				GROUP BY
					C.idcategory
				ORDER BY
					C.distinction ASC
			';
        $stmt = Db::getInstance()->prepare($sql);
        $stmt->BindParam('languageid', Helper::getLanguageId());
        $stmt->BindParam('viewid', Helper::getViewId());
        $stmt->execute();
        $Data = array();
        while ($rs = $stmt->fetch()) {
            $Data[] = array('catid' => $rs['id'], 'catname' => $rs['label']);
        }
        return $Data;
    }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:27,代码来源:skapiec.php

示例5: getActiveLayer

 public function getActiveLayer()
 {
     $storeid = !is_null(Helper::getStoreId()) ? Helper::getStoreId() : 0;
     $viewid = !is_null(Helper::getViewId()) ? Helper::getViewId() : 0;
     if ($viewid > 0) {
         return $storeid . '_' . $viewid;
     } else {
         return $storeid;
     }
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:10,代码来源:stores.php

示例6: getMainCategories

 public function getMainCategories()
 {
     $sql = "SELECT \n\t\t\t\t\tC.idcategory, \n\t\t\t\t\tCT.name,\n\t\t\t\t\tCT.seo,\n\t\t\t\t\tC.photoid,\n\t\t\t\t\tCT.shortdescription,\n\t\t\t\t\tCT.description,\n     \t\t\t\tCOUNT(PC.productid) AS totalproducts,\n     \t\t\t\tMIN(P.sellprice) AS minsellprice\n\t\t\t\tFROM category C\n\t\t\t\tLEFT JOIN viewcategory VC ON VC.categoryid = C.idcategory\n\t\t\t\tLEFT JOIN categorypath CP ON CP.ancestorcategoryid = C.idcategory\n\t\t\t\tLEFT JOIN productcategory PC ON CP.categoryid = PC.categoryid\n\t\t\t\tLEFT JOIN product P ON PC.productid = P.idproduct\n\t\t\t\tLEFT JOIN categorytranslation CT ON CT.categoryid = idcategory AND CT.languageid = :languageid\n\t\t\t\tWHERE C.categoryid IS NULL AND VC.viewid=:viewid AND C.enable = 1\n\t\t\t\tGROUP BY C.idcategory";
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('viewid', Helper::getViewId());
     $stmt->bindValue('languageid', Helper::getLanguageId());
     $stmt->execute();
     $Data = array();
     while ($rs = $stmt->fetch()) {
         $Data[] = array('name' => $rs['name'], 'idcategory' => $rs['idcategory'], 'qry' => $rs['totalproducts'], 'seo' => $rs['seo'], 'minsellprice' => $this->registry->core->processPrice($rs['minsellprice']), 'shortdescription' => $rs['shortdescription'], 'description' => $rs['description'], 'photo' => $this->getImagePath($rs['photoid']));
     }
     return $Data;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:13,代码来源:maincategoriesbox.php

示例7: getAllMostSearched

 public function getAllMostSearched()
 {
     $top_count = $this->getTopSearched(Helper::getViewId());
     $sql = "SELECT \n\t\t\t\t\tidmostsearch,\n\t\t\t\t\tname, \n\t\t\t\t\ttextcount\n\t\t\t\tFROM mostsearch\n\t\t\t\tWHERE viewid = :viewid";
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('viewid', Helper::getViewId());
     $stmt->execute();
     $Data = array();
     while ($rs = $stmt->fetch()) {
         $Data[] = array('idmostsearch' => $rs['idmostsearch'], 'name' => $rs['name'], 'phrase' => $rs['name'], 'textcount' => $rs['textcount'], 'percentage' => ceil($rs['textcount'] / $top_count['textcount'] * 100));
     }
     return $Data;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:13,代码来源:mostsearchedbox.php

示例8: getContactList

 public function getContactList()
 {
     $sql = "SELECT\n\t\t\t\t\tC.idcontact,\n\t\t\t\t\tCT.name, \n\t\t\t\t\tCT.email, \n\t\t\t\t\tCT.phone, \n\t\t\t\t\tCT.fax, \n\t\t\t\t\tCT.street, \n\t\t\t\t\tCT.streetno, \n\t\t\t\t\tCT.placeno, \n\t\t\t\t\tCT.placename, \n\t\t\t\t\tCT.postcode,\n\t\t\t\t\tCT.businesshours\n\t\t\t\tFROM contact C\n\t\t\t\tLEFT JOIN contacttranslation CT ON CT.contactid = C.idcontact AND CT.languageid = :languageid\n\t\t\t\tLEFT JOIN contactview CV ON CV.contactid = C.idcontact\n\t\t\t\tWHERE C.publish = 1 AND CV.viewid = :viewid\n\t\t\t\tORDER BY C.idcontact";
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('viewid', Helper::getViewId());
     $stmt->bindValue('languageid', Helper::getLanguageId());
     $Data = array();
     try {
         $stmt->execute();
         while ($rs = $stmt->fetch()) {
             $Data[$rs['idcontact']] = array('idcontact' => $rs['idcontact'], 'name' => $rs['name'], 'phone' => $rs['phone'], 'fax' => $rs['fax'], 'email' => $rs['email'], 'street' => $rs['street'], 'streetno' => $rs['streetno'], 'placeno' => $rs['placeno'], 'placename' => $rs['placename'], 'postcode' => $rs['postcode'], 'businesshours' => $rs['businesshours']);
         }
     } catch (Exception $e) {
         throw new FrontendException($fe->getMessage('ERR_QUERY_WISHLIST'));
     }
     return $Data;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:17,代码来源:contact.php

示例9: initDatagrid

    protected function initDatagrid($datagrid)
    {
        $datagrid->setTableData('dispatchmethod', array('iddispatchmethod' => array('source' => 'D.iddispatchmethod'), 'name' => array('source' => 'DMT.name', 'prepareForAutosuggest' => true, 'processLanguage' => true), 'countries' => array('source' => 'D.countryids', 'processFunction' => array($this, 'getCountriesForDispatchmethod')), 'hierarchy' => array('source' => 'D.hierarchy')));
        $datagrid->setFrom('
			dispatchmethod D
			LEFT JOIN dispatchmethodview DV ON DV.dispatchmethodid = D.iddispatchmethod
      LEFT JOIN dispatchmethodtranslation DMT ON DMT.dispatchmethodid = D.iddispatchmethod AND DMT.languageid = :languageid
		');
        $datagrid->setGroupBy('
			D.iddispatchmethod
		');
        if (Helper::getViewId() > 0) {
            $datagrid->setAdditionalWhere('
				DV.viewid IN (' . Helper::getViewIdsAsString() . ') 
			');
        }
    }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:17,代码来源:dispatchmethod.php

示例10: initDatagrid

    protected function initDatagrid($datagrid)
    {
        $datagrid->setTableData('producer', array('idproducer' => array('source' => 'P.idproducer'), 'name' => array('source' => 'PT.name', 'prepareForAutosuggest' => true), 'adddate' => array('source' => 'P.adddate')));
        $datagrid->setFrom('
			producer P
			LEFT JOIN producertranslation PT ON PT.producerid = P.idproducer AND PT.languageid = :languageid
			LEFT JOIN producerview PV ON PV.producerid = P.idproducer
		');
        if (Helper::getViewId() > 0) {
            $datagrid->setAdditionalWhere('
				PV.viewid IN (' . Helper::getViewIdsAsString() . ')
			');
        }
        $datagrid->setGroupBy('
			P.idproducer
		');
    }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:17,代码来源:producer.php

示例11: getNewsById

 public function getNewsById($id)
 {
     $sql = "SELECT \n\t\t\t\t\tN.idnews, \n\t\t\t\t\tNT.topic, \n\t\t\t\t\tNT.summary,\n\t\t\t\t\tNT.content,\n\t\t\t\t\tNT.seo,\n\t\t\t\t\tNT.keyword_title,\n\t\t\t\t\tNT.keyword,\n\t\t\t\t\tNT.keyword_description,\n\t\t\t\t\tN.adddate,\n\t\t\t\t\tN.featured\n\t\t\t\tFROM news N\n\t\t\t\tLEFT JOIN newsview NV ON NV.newsid = idnews\n\t\t\t\tLEFT JOIN newstranslation NT ON N.idnews = NT.newsid AND NT.languageid = :languageid\n\t\t\t\tWHERE\n\t\t\t\t\tidnews=:id\n\t\t\t\tAND\n\t\t\t\t\tpublish = 1\n\t\t\t\tAND\n\t\t\t\t\tIF((N.startdate IS NULL OR N.startdate = '0000-00-00 00:00:00' OR N.startdate <= CURDATE()) AND (N.enddate IS NULL OR N.enddate = '0000-00-00 00:00:00' OR N.enddate >= CURDATE()), 1, 0)\n\t\t\t\t\t\n\t\t\t\tAND\n\t\t\t\t\tNV.viewid = :viewid\n\t\t\t\tORDER BY N.`adddate` desc";
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('id', $id);
     $stmt->bindValue('languageid', Helper::getLanguageId());
     $stmt->bindValue('viewid', Helper::getViewId());
     $stmt->execute();
     $rs = $stmt->fetch();
     $Data = array();
     if ($rs) {
         $Data = array('featured' => $rs['featured'], 'topic' => $rs['topic'], 'adddate' => $rs['adddate'], 'summary' => $rs['summary'], 'content' => $rs['content'], 'seo' => $rs['seo'], 'link' => $this->generateUrl($rs['idnews'], $rs['seo']), 'keyword_title' => $rs['keyword_title'] == NULL || $rs['keyword_title'] == '' ? $rs['topic'] : $rs['keyword_title'], 'keyword' => $rs['keyword'], 'keyword_description' => $rs['keyword_description'], 'mainphoto' => $this->getPhotosByNewsId($id), 'otherphoto' => $this->getOtherPhotosByNewsId($id));
         return $Data;
     } else {
         App::redirectUrl($this->registry->router->generate('frontend.news', true));
     }
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:17,代码来源:news.php

示例12: getProductListIntegration

 public function getProductListIntegration()
 {
     $sql = "SELECT\n\t\t\t\t\tPC.categoryid AS id,\n\t\t\t\t\tP.idproduct,\n\t\t\t\t\tPT.name,\n\t\t\t\t\tIF(P.promotion = 1 AND IF(P.promotionstart IS NOT NULL, P.promotionstart <= CURDATE(), 1) AND IF(P.promotionend IS NOT NULL, P.promotionend >= CURDATE(), 1), P.discountprice * (1 + (V.value / 100)) * CR.exchangerate, NULL) AS discountprice,\n\t\t\t\t\t(P.sellprice * (1 + (V.value / 100)) * CR.exchangerate) AS sellprice,\n\t\t\t\t\tPT.shortdescription,\n\t\t\t\t\tPhoto.photoid,\n\t\t\t\t\tPT.seo,\n\t\t\t\t\tCT.name AS categoryname,\n\t\t\t\t\tPRT.name AS producername\n\t\t\t\tFROM product P\n\t\t\t\tLEFT JOIN producttranslation PT ON PT.productid = P.idproduct AND PT.languageid=:languageid\n\t\t\t\tLEFT JOIN productcategory PC ON PC.productid = P.idproduct\n\t\t\t\tINNER JOIN viewcategory VC ON VC.categoryid = PC.categoryid AND VC.viewid = :viewid\n\t\t\t\tLEFT JOIN categorytranslation CT ON PC.categoryid = CT.categoryid AND CT.languageid = :languageid\n\t\t\t\tLEFT JOIN producertranslation PRT ON PRT.producerid = P.producerid AND PRT.languageid = :languageid\n\t\t\t\tLEFT JOIN productphoto Photo ON Photo.productid = P.idproduct AND Photo.mainphoto = 1\n\t\t\t\tLEFT JOIN vat V ON P.vatid= V.idvat\n\t\t\t\tLEFT JOIN currencyrates CR ON CR.currencyfrom = P.sellcurrencyid AND CR.currencyto = :currencyto\n\t\t\t\tWHERE P.enable = 1\n\t            GROUP BY P.idproduct";
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('viewid', Helper::getViewId());
     $stmt->bindValue('languageid', Helper::getLanguageId());
     $stmt->bindValue('currencyto', Session::getActiveCurrencyId());
     $stmt->execute();
     $Data = array();
     while ($rs = $stmt->fetch()) {
         $Data[] = array('categoryid' => $rs['id'], 'seo' => $rs['seo'], 'categoryname' => $rs['categoryname'], 'producername' => $rs['producername'], 'productid' => $rs['idproduct'], 'name' => $rs['name'], 'shortdescription' => $rs['shortdescription'], 'sellprice' => number_format(!is_null($rs['discountprice']) ? $rs['discountprice'] : $rs['sellprice'], 2), 'photoid' => $rs['photoid'], 'idproduct' => $rs['idproduct']);
     }
     foreach ($Data as $key => $Product) {
         $Image = App::getModel('gallery')->getOrginalImageById($Product['photoid']);
         $Data[$key]['photo'] = App::getModel('gallery')->getImagePath($Image, App::getURLAdress());
     }
     return $Data;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:18,代码来源:okazje.php

示例13: authProccess

 public function authProccess($login)
 {
     $hash = new \PasswordHash\PasswordHash();
     $sql = 'SELECT idclient, disable FROM client WHERE login = :login AND viewid = :viewid';
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('login', $hash->HashLogin($login));
     $stmt->bindValue('viewid', Helper::getViewId());
     $stmt->execute();
     $rs = $stmt->fetch();
     if ($rs) {
         if ($rs['disable'] == 0) {
             return $rs['idclient'];
         } else {
             return -1;
         }
     } else {
         return 0;
     }
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:19,代码来源:forgotpassword.php

示例14: getCategoryById

 public function getCategoryById($id)
 {
     $sql = "SELECT\n\t\t\t\t\tCT.categoryid,\n\t\t\t\t\tCT.name,\n\t\t\t\t\tCT.seo,\n\t\t\t\t\tCT.shortdescription,\n\t\t\t\t\tCT.description,\n\t\t\t\t\tC.photoid,\n\t\t\t\t\tC.categoryid AS parent\n\t\t\t\tFROM categorytranslation CT\n\t\t\t\tLEFT JOIN category C ON CT.categoryid = C.idcategory\n\t\t\t\tLEFT JOIN viewcategory VC ON CT.categoryid = VC.categoryid \n\t\t\t\tWHERE C.idcategory =:id AND CT.languageid = :languageid AND VC.viewid = :viewid AND C.enable = 1";
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('languageid', Helper::getLanguageId());
     $stmt->bindValue('viewid', Helper::getViewId());
     $stmt->bindValue('id', $id);
     try {
         $stmt->execute();
         $rs = $stmt->fetch();
     } catch (Exception $e) {
         throw new FrontendException($e->getMessage());
     }
     $Data = array();
     if ($rs) {
         $Data = array('id' => $rs['categoryid'], 'name' => $rs['name'], 'seo' => $rs['seo'], 'shortdescription' => $rs['shortdescription'], 'description' => $rs['description'], 'photo' => $this->getImagePath($rs['photoid']));
     }
     return $Data;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:19,代码来源:categorylist.php

示例15: __construct

 public function __construct($registry)
 {
     parent::__construct($registry);
     $this->queryColumns = array();
     $this->queryFrom = '';
     $this->queryGroupBy = '';
     $this->queryOrderBy = '';
     $this->queryHaving = '';
     $this->queryLimit = 100;
     $this->queryOffset = 0;
     $this->pagination = 100;
     $this->currentPage = 0;
     $this->sqlParams = array();
     $this->encryptionKey = Session::getActiveEncryptionKeyValue();
     $this->languageId = Helper::getLanguageId();
     $this->viewId = !is_null(Helper::getViewId()) ? Helper::getViewId() : 0;
     $this->queryAdditionalWhere = '';
     $this->DataSet = array();
     $this->cacheEnabled = array('enabled' => false, 'lifetime' => 3600, 'cacheid' => null);
     $this->layerData = $this->registry->loader->getCurrentLayer();
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:21,代码来源:dataset.php


注:本文中的Helper::getViewId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。