Guest User

Untitled

a guest
Apr 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. public static function getPrice_list(){
  2. $model = array(
  3. 0=>"0 - 250.000",
  4. 1=>"250.000 - 600.000",
  5. 2=>"600.000 - 1.000.000",
  6. 3=>"1.000.000 -",
  7. 4=>"Every",
  8.  
  9. );
  10. return $model;
  11. }
  12.  
  13. 'price'=>array(self::HAS_MANY, 'UserAndApartmanPrice', 'user_and_apartman_id')
  14.  
  15. $criteria = new CDbCriteria;
  16. $criteria->with = array( 'apartman','price');
  17. $criteria->together = true;
  18. if($_POST['sell_price'] != 4){
  19. if($_POST['sell_price'] == 0){
  20. // this is the question
  21. }
  22. ...
  23. }
  24.  
  25. $model = UserAndApartman::model()->findAll($criteria);
  26.  
  27. $criteria = new CDbCriteria;
  28. $criteria->together = true;
  29. $list = UserAndApartman::getPriceList(0);
  30. $criteria->with = array(
  31. 'description' => array(
  32. 'condition' => 'main != :main AND valuta = :valuta AND value BETWEEN :value1 AND :value2',
  33. 'params' => array(
  34. ':main' => 10,
  35. ':valuta' => 1,
  36. ':value1' => $list[0],
  37. ':value2' => $list[1],
  38. )
  39. )
  40. );
  41.  
  42. public static function getPriceList( $id ) {
  43. $list = array(
  44. 0 => array("0", "250.000"),
  45. 1 => array("250.000", "600.000"),
  46. 2 => array("600.000", "1.000.000"),
  47. 3 => array("1.000.000", '9999999999999'),
  48. 4 => array('0', '9999999999999'),
  49. );
  50.  
  51. return $list[$id];
  52. }
Add Comment
Please, Sign In to add comment