OXID eShop CE  4.10.4
 All Classes Namespaces Files Functions Variables Pages
pricealarm_list.php
Go to the documentation of this file.
1 <?php
2 
9 {
10 
16  protected $_sThisTemplate = 'pricealarm_list.tpl';
17 
23  protected $_sListClass = 'oxpricealarm';
24 
30  protected $_sDefSortField = "oxuserid";
31 
39  protected function _buildSelectString($oListObject = null)
40  {
41  $sViewName = getViewName("oxarticles", (int) $this->getConfig()->getConfigParam("sDefaultLang"));
42  $sSql = "select oxpricealarm.*, {$sViewName}.oxtitle AS articletitle, ";
43  $sSql .= "oxuser.oxlname as userlname, oxuser.oxfname as userfname ";
44  $sSql .= "from oxpricealarm left join {$sViewName} on {$sViewName}.oxid = oxpricealarm.oxartid ";
45  $sSql .= "left join oxuser on oxuser.oxid = oxpricealarm.oxuserid WHERE 1 ";
46 
47  return $sSql;
48  }
49 
55  public function buildWhere()
56  {
57  $this->_aWhere = parent::buildWhere();
58  $sViewName = getViewName("oxpricealarm");
59  $sArtViewName = getViewName("oxarticles");
60 
61  // updating price fields values for correct search in DB
62  if (isset($this->_aWhere[$sViewName . '.oxprice'])) {
63  $sPriceParam = (double) str_replace(array('%', ','), array('', '.'), $this->_aWhere[$sViewName . '.oxprice']);
64  $this->_aWhere[$sViewName . '.oxprice'] = '%' . $sPriceParam . '%';
65  }
66 
67  if (isset($this->_aWhere[$sArtViewName . '.oxprice'])) {
68  $sPriceParam = (double) str_replace(array('%', ','), array('', '.'), $this->_aWhere[$sArtViewName . '.oxprice']);
69  $this->_aWhere[$sArtViewName . '.oxprice'] = '%' . $sPriceParam . '%';
70  }
71 
72 
73  return $this->_aWhere;
74  }
75 }