本文整理汇总了PHP中Helper::getLanguageId方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::getLanguageId方法的具体用法?PHP Helper::getLanguageId怎么用?PHP Helper::getLanguageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper
的用法示例。
在下文中一共展示了Helper::getLanguageId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例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;
}
示例3: getBoxesAll
public function getBoxesAll($subpage, $pageschemeid)
{
$Data = array();
$sql = '
SELECT
LB.idlayoutbox AS id,
LB.name,
LB.controller,
LBT.title
FROM
layoutbox LB
LEFT JOIN layoutboxtranslation LBT ON LBT.layoutboxid = LB.idlayoutbox
WHERE
LBT.languageid = :languageid AND
LB.pageschemeid = :pageschemeid
ORDER BY
LB.name ASC
';
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('languageid', Helper::getLanguageId());
$stmt->bindValue('pageschemeid', $pageschemeid);
$stmt->execute();
while ($rs = $stmt->fetch()) {
if ($subpage != '' && $this->checkBoxForSubpage($rs['controller'], $subpage) == 1) {
$Data[] = array('id' => $rs['id'], 'name' => $rs['name'] . ' - ' . $rs['title']);
}
}
return $Data;
}
示例4: 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;
}
示例5: 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;
}
示例6: getControllerSeoAll
public function getControllerSeoAll()
{
$sql = 'SELECT name as translation FROM controllerseo WHERE languageid = :languageid';
$Data = array();
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('languageid', Helper::getLanguageId());
$stmt->execute();
while ($rs = $stmt->fetch()) {
$Data[] = array('translation' => $rs['translation']);
}
return $Data;
}
示例7: 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;
}
示例8: getOrderList
public function getOrderList()
{
$sql = "SELECT O.idorder as id, O.price, O.adddate as date, O.globalprice, O.dispatchmethodprice,\n\t\t\t\t\t\tO.dispatchmethodname, O.paymentmethodname,\n\t\t\t\t\t\tOST.name as orderstatusname,\n\t\t\t\t\t\tOCDelivery.firstname, OCDelivery.surname, OCDelivery.street, OCDelivery.streetno,\n\t\t\t\t\t\tOCDelivery.companyname, OCDelivery.NIP, OCDelivery.placeno, OCDelivery.postcode,\n\t\t\t\t\t\tOCDelivery.place,\n\t\t\t\t\t\tOCDelivery.phone,\n\t\t\t\t\t\tOCDelivery.phone2,\n\t\t\t\t\t\tOCDelivery.email\n\t\t\t\t\tFROM `order` O\n\t\t\t\t\tLEFT JOIN orderstatus OS ON OS.idorderstatus=O.orderstatusid\n \t\t\tLEFT JOIN orderstatustranslation OST ON OST.orderstatusid = OS.idorderstatus\n \t\t\tAND OST.languageid= :languageid\n\t\t\t\t\tLEFT JOIN orderclientdeliverydata OCDelivery ON OCDelivery.orderid= O.idorder";
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('languageid', Helper::getLanguageId());
$stmt->execute();
$rs = $stmt->fetch();
$Data = array();
while ($rs = $stmt->fetch()) {
$Data[] = array('id' => $rs['id'], 'price' => $rs['price'], 'orderdate' => $rs['date'], 'globalprice' => $rs['globalprice'], 'dispatchmethodprice' => $rs['dispatchmethodprice'], 'dispatchmethodname' => $rs['dispatchmethodname'], 'paymentmethodname' => $rs['paymentmethodname'], 'orderstatusname' => $rs['orderstatusname'], 'firstname' => $rs['firstname'], 'surname' => $rs['surname'], 'street' => $rs['street'], 'streetno' => $rs['streetno'], 'companyname' => $rs['companyname'], 'NIP' => $rs['nip'], 'placeno' => $rs['placeno'], 'postcode' => $rs['postcode'], 'place' => $rs['place'], 'phone' => $rs['phone'], 'phone2' => $rs['phone2'], 'email' => $rs['email']);
}
return $Data;
}
示例9: getNews
public function getNews()
{
$sql = "SELECT \n\t\t\t\tCONCAT(:url,:seo,'/',N.idnews,'/',NT.seo) as loc,\n\t\t\t\tDATE_FORMAT(N.adddate,'%Y-%m-%d') as lastmod\n\t\t\t\tFROM news N\n\t\t\t\tLEFT JOIN newstranslation NT ON N.idnews = NT.newsid AND NT.languageid = :languageid\n\t\t\t\tWHERE N.publish = 1\n\t\t\t\tGROUP BY N.idnews";
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('url', URL);
$stmt->bindValue('languageid', Helper::getLanguageId());
$stmt->bindValue('seo', Seo::getSeo('news'));
$stmt->execute();
$Data = array();
while ($rs = $stmt->fetch()) {
$Data[] = array('loc' => $rs['loc'], 'lastmod' => $rs['lastmod']);
}
return $Data;
}
示例10: 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\tP.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\t(SELECT\n\t\t\t\t\t GROUP_CONCAT(SUBSTRING(CT.name, 1) ORDER BY C.order DESC SEPARATOR ' / ')\n\t\t\t\t\tFROM categorytranslation CT\n\t\t\t\t\tLEFT JOIN categorypath C ON C.ancestorcategoryid = CT.categoryid\n\t\t\t\t\tWHERE C.categoryid = PC.categoryid AND CT.languageid = :languageid) AS webkupiec,\n\t\t\t\t\tPRT.name AS producername,\n\t\t\t\t\tP.weight\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\tLEFT JOIN categorypath CP ON CP.ancestorcategoryid = PC.categoryid\n\t\t\t\tLEFT JOIN categorytranslation CT ON CP.ancestorcategoryid = 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\tWHERE P.enable = 1\n\t GROUP BY P.idproduct";
$stmt = Db::getInstance()->prepare($sql);
$stmt->BindParam('languageid', Helper::getLanguageId());
$stmt->execute();
$Data = array();
while ($rs = $stmt->fetch()) {
$Data[] = array('categoryid' => $rs['id'], 'seo' => $rs['seo'], 'categoryname' => $rs['webkupiec'], 'producername' => $rs['producername'], 'productid' => $rs['idproduct'], 'name' => $rs['name'], 'shortdescription' => $rs['shortdescription'], 'sellprice' => $rs['sellprice'], '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;
}
示例11: 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\tP.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\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\tLEFT JOIN categorytranslation CT ON PC.categoryid = CT.categoryid AND CT.languageid = :languageid\n\t\t\t\tLEFT JOIN productphoto Photo ON Photo.productid = P.idproduct AND Photo.mainphoto = 1\n\t\t\t\tWHERE P.enable = 1\n\t GROUP BY P.idproduct";
$stmt = Db::getInstance()->prepare($sql);
$stmt->BindParam('languageid', Helper::getLanguageId());
$stmt->execute();
$Data = array();
while ($rs = $stmt->fetch()) {
$Data[] = array('categoryid' => $rs['id'], 'seo' => $rs['seo'], 'categoryname' => $rs['categoryname'], 'productid' => $rs['idproduct'], 'name' => $rs['name'], 'shortdescription' => $rs['shortdescription'], 'sellprice' => $rs['sellprice'], '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;
}
示例12: 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));
}
}
示例13: getProductListIntegration
public function getProductListIntegration()
{
$sql = "SELECT\n\t\t\t\t\tP.idproduct,\n\t\t\t\t\tPT.name,\n\t\t\t\t\t(P.sellprice * (1 + (V.value / 100)) * CR.exchangerate) AS sellprice,\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\tPT.shortdescription,\n\t\t\t\t\tPhoto.photoid,\n\t\t\t\t\tPRT.name AS producername,\n\t\t\t\t\tPT.seo,\n\t\t\t\t\t(SELECT\n\t\t\t\t\t GROUP_CONCAT(SUBSTRING(CT.name, 1) ORDER BY C.order DESC SEPARATOR ' / ')\n\t\t\t\t\tFROM categorytranslation CT\n\t\t\t\t\tLEFT JOIN categorypath C ON C.ancestorcategoryid = CT.categoryid\n\t\t\t\t\tWHERE C.categoryid = PC.categoryid AND CT.languageid = :languageid) AS kreocen\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\tLEFT JOIN categorypath CP ON CP.ancestorcategoryid = PC.categoryid\n\t\t\t\tLEFT JOIN categorytranslation CT ON CP.ancestorcategoryid = CT.categoryid AND CT.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 producertranslation PRT ON PRT.producerid = P.producerid AND PRT.languageid = :languageid\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->bindParam('languageid', Helper::getLanguageId());
$stmt->bindParam('currencyto', Session::getActiveCurrencyId());
$stmt->execute();
$Data = array();
while ($rs = $stmt->fetch()) {
$Data[] = array('productid' => $rs['idproduct'], 'seo' => $rs['seo'], 'name' => $rs['name'], 'shortdescription' => $rs['shortdescription'], 'sellprice' => number_format(!is_null($rs['discountprice']) ? $rs['discountprice'] : $rs['sellprice'], 2), 'photoid' => $rs['photoid'], 'idproduct' => $rs['idproduct'], 'producername' => $rs['producername'], 'kreocen' => $rs['kreocen']);
}
foreach ($Data as $key => $Product) {
$Image = App::getModel('gallery')->getOrginalImageById($Product['photoid']);
$Data[$key]['photo'] = App::getModel('gallery')->getImagePath($Image, App::getURLAdress());
}
return $Data;
}
示例14: 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;
}
示例15: getProducerBySeo
public function getProducerBySeo($seo)
{
$sql = "SELECT\n\t\t\t\t\tP.photoid,\n\t\t\t\t\tPT.producerid,\n\t\t\t\t\tPT.name,\n\t\t\t\t\tPT.seo,\n\t\t\t\t\tPT.description,\n\t\t\t\t\tPT.keyword_title,\n\t\t\t\t\tPT.keyword,\n\t\t\t\t\tPT.keyword_description\n\t\t\t\tFROM producertranslation PT\n\t\t\t\tLEFT JOIN producer P ON P.idproducer = PT.producerid\n\t\t\t\tWHERE PT.seo =:seo AND PT.languageid = :languageid";
$stmt = Db::getInstance()->prepare($sql);
$stmt->bindValue('languageid', Helper::getLanguageId());
$stmt->bindValue('seo', $seo);
try {
$stmt->execute();
$rs = $stmt->fetch();
} catch (Exception $e) {
throw new FrontendException($e->getMessage());
}
$Data = array();
if ($rs) {
$Data = array('id' => $rs['producerid'], 'name' => $rs['name'], 'description' => $rs['description'], 'seo' => $rs['seo'], 'photo' => $this->getImagePath($rs['photoid']), 'keyword_title' => $rs['keyword_title'] == NULL || $rs['keyword_title'] == '' ? $rs['name'] : $rs['keyword_title'], 'keyword' => $rs['keyword'], 'keyword_description' => $rs['keyword_description']);
}
return $Data;
}