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