Subversion Repositories SmartDukaan

Rev

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

Rev 13815 Rev 13816
Line 19... Line 19...
19
		parent::beforeFilter();
19
		parent::beforeFilter();
20
		$this->Auth->allow('add','mine');
20
		$this->Auth->allow('add','mine');
21
		$this->apihost = Configure::read('pythonapihost');
21
		$this->apihost = Configure::read('pythonapihost');
22
	}
22
	}
23
	
23
	
24
	public function mine($page=1) {
24
	public function mine() {
-
 
25
		$page = $this->request->query('page');
-
 
26
		$page = isset($page)?$page:1;
25
		$userId = $this->request->query('user_id');
27
		$userId = $this->request->query('user_id');
26
		if(isset($userId) && !empty($userId)){
28
		if(isset($userId) && !empty($userId)){
27
			$this->loadModel('User');
29
			$this->loadModel('User');
28
			$dbuser = $this->User->findById($userId);
30
			$dbuser = $this->User->findById($userId);
29
			$this->Auth->login($dbuser['User']);	
31
			$this->Auth->login($dbuser['User']);	
Line 34... Line 36...
34
		$totalPages = $response['totalPages'];
36
		$totalPages = $response['totalPages'];
35
		if(!empty($response['data'])){
37
		if(!empty($response['data'])){
36
			$this->set('orders',$response['data']);
38
			$this->set('orders',$response['data']);
37
		}
39
		}
38
		$ignoredFields = array('imgUrl','status','productTitle','estimatedDeliveryDate','productCode','merchantSubOrderId','productUrl','closed','tracingkUrl','detailedStatus');
40
		$ignoredFields = array('imgUrl','status','productTitle','estimatedDeliveryDate','productCode','merchantSubOrderId','productUrl','closed','tracingkUrl','detailedStatus');
39
		$this->set(compact('ignoredFields','page','totalPages'));
41
		$this->set(compact('ignoredFields','page','totalPages','userId'));
40
	}
42
	}
41
 
43
 
42
	public function pendingcashbacks() {
44
	public function pendingcashbacks() {
43
		$userId = $this->request->query('user_id');
45
		$userId = $this->request->query('user_id');
44
		if(isset($userId) && !empty($userId)){
46
		if(isset($userId) && !empty($userId)){