BoxPrice.php
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
*
* @author liuziyang
* @version
*/
/**
* BoxPrice helper
*
* @uses viewHelper Zend_View_Helper
*/
class Web_View_Helper_BoxPrice extends Zend_View_Helper_Abstract {
/**
* @var Zend_View_Interface
*/
public $view;
/**
*
*/
public function boxPrice($sort_ids) {
$max_sort_id = empty($sort_ids['msort']) ? 0 : $sort_ids['msort'];
$middle_sort_id = empty($sort_ids['misort']) ? 0 : $sort_ids['misort'];
$small_sort_id = empty($sort_ids['sort']) ? 0 : $sort_ids['sort'];
if (isset($this->view->view_is_promotion)) {
$this->view->boxMaxPrice = $maxPrice = intval(QModels_Product_Price_Client::getMaxPriceBySort($max_sort_id, $middle_sort_id, $small_sort_id, 'Y'));
}
else {
$this->view->boxMaxPrice = $maxPrice = intval(QModels_Product_Price_Client::getMaxPriceBySort($max_sort_id, $middle_sort_id, $small_sort_id));
}
$this->view->boxMinPrice = $minPrice = intval(QModels_Product_Price_Client::getMinPriceBySort($max_sort_id, $middle_sort_id, $small_sort_id));
if ($minPrice < 1 && $maxPrice < 1) {
return null;
}
return $this->view->render('box/price.phtml');
}
/**
* Sets the view field
* @param $view Zend_View_Interface
*/
public function setView(Zend_View_Interface $view) {
$this->view = $view;
}
}