Subversion Repositories SmartDukaan

Rev

Rev 13541 | Rev 13579 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13541 Rev 13567
Line 46... Line 46...
46
		    '_serialize' => array('result')
46
		    '_serialize' => array('result')
47
		));
47
		));
48
		$this->render('/Elements/jsonp');
48
		$this->render('/Elements/jsonp');
49
	}
49
	}
50
 
50
 
-
 
51
	public function deals(){
-
 
52
		$this->loadModel('Api');
-
 
53
		$apideals = $this->Api->getCategoryDeals($this->Auth->User('id'),1);
-
 
54
		$categorydeals = $apideals['products'];
-
 
55
		$rows = sizeof($categorydeals);
-
 
56
		if($rows>=1){
-
 
57
			$this->set('deals',$categorydeals);
-
 
58
			$this->render('categorydeals');
-
 
59
		}else{
-
 
60
			foreach ($categorydeals as $key => $dealarr) {
-
 
61
				foreach ($dealarr as $key => $deal) {
-
 
62
					$deals[] = $deal[0];
-
 
63
				}				
-
 
64
			}
-
 
65
			$this->set(compact('deals'));
-
 
66
		}		
-
 
67
	}
51
/**
68
/*
-
 
69
	*
52
 * view method
70
 * view method
53
 *
71
 *
54
 * @throws NotFoundException
72
 * @throws NotFoundException
55
 * @param string $id
73
 * @param string $id
56
 * @return void
74
 * @return void