| 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() {
|
24 |
public function mine($page=1) {
|
| 25 |
$userId = $this->request->query('user_id');
|
25 |
$userId = $this->request->query('user_id');
|
| 26 |
if(isset($userId) && !empty($userId)){
|
26 |
if(isset($userId) && !empty($userId)){
|
| 27 |
$this->loadModel('User');
|
27 |
$this->loadModel('User');
|
| 28 |
$dbuser = $this->User->findById($userId);
|
28 |
$dbuser = $this->User->findById($userId);
|
| 29 |
$this->Auth->login($dbuser['User']);
|
29 |
$this->Auth->login($dbuser['User']);
|
| 30 |
}
|
30 |
}
|
| 31 |
$this->layout = "innerpages";
|
31 |
$this->layout = "innerpages";
|
| 32 |
$url = $this->apihost."storeorder/user/".$this->Auth->User('id')."?page=1&window=10";
|
32 |
$url = $this->apihost."storeorder/user/".$this->Auth->User('id')."?page=$page&window=10";
|
| 33 |
$response = $this->make_request($url,null);
|
33 |
$response = $this->make_request($url,null);
|
| - |
|
34 |
$totalPages = $response['totalPages'];
|
| 34 |
if(!empty($response['data'])){
|
35 |
if(!empty($response['data'])){
|
| 35 |
$this->set('orders',$response['data']);
|
36 |
$this->set('orders',$response['data']);
|
| 36 |
}
|
37 |
}
|
| 37 |
$ignoredFields = array('imgUrl','status','productTitle','estimatedDeliveryDate','productCode','merchantSubOrderId','productUrl','closed','tracingkUrl','detailedStatus');
|
38 |
$ignoredFields = array('imgUrl','status','productTitle','estimatedDeliveryDate','productCode','merchantSubOrderId','productUrl','closed','tracingkUrl','detailedStatus');
|
| 38 |
$this->set('ignoredFields',$ignoredFields);
|
39 |
$this->set(compact('ignoredFields','page','totalPages'));
|
| 39 |
}
|
40 |
}
|
| 40 |
|
41 |
|
| 41 |
public function pendingcashbacks() {
|
42 |
public function pendingcashbacks() {
|
| 42 |
$userId = $this->request->query('user_id');
|
43 |
$userId = $this->request->query('user_id');
|
| 43 |
if(isset($userId) && !empty($userId)){
|
44 |
if(isset($userId) && !empty($userId)){
|