| Line 1158... |
Line 1158... |
| 1158 |
}
|
1158 |
}
|
| 1159 |
|
1159 |
|
| 1160 |
$this->set(compact('userSanctions','usersMap','hasMore','totalCount'));
|
1160 |
$this->set(compact('userSanctions','usersMap','hasMore','totalCount'));
|
| 1161 |
}
|
1161 |
}
|
| 1162 |
|
1162 |
|
| 1163 |
public function admin_credithistory(){
|
1163 |
public function admin_credithistory($cuid = 0){
|
| - |
|
1164 |
$page = $this->request->query('page');
|
| - |
|
1165 |
if(!isset($page)){
|
| - |
|
1166 |
$page = 1;
|
| - |
|
1167 |
}
|
| - |
|
1168 |
$limit = 20;
|
| - |
|
1169 |
$offset = ($page - 1)*$limit;
|
| 1164 |
$url = Configure::read('saholicapihost').'counter!getCreditHistory?limit=0&offset=0';
|
1170 |
$url = Configure::read('saholicapihost').'counter!getCreditHistory?userId='.$cuid.'&limit='.$limit.'&offset='.$offset;
|
| 1165 |
$response = $this->make_request ( $url, null );
|
1171 |
$response = $this->make_request ( $url, null );
|
| 1166 |
$creditHistory = $response['response']['creditHistory'];
|
1172 |
$creditHistory = $response['response']['creditHistory'];
|
| 1167 |
$hasMore = $response['response']['hasMore'];
|
1173 |
$hasMore = $response['response']['hasMore'];
|
| 1168 |
$totalCount = $response['response']['totalCount'];
|
1174 |
$totalCount = $response['response']['totalCount'];
|
| 1169 |
$this->loadModel('UserAccount');
|
1175 |
$this->loadModel('UserAccount');
|
| Line 1173... |
Line 1179... |
| 1173 |
$options = array('conditions'=>array('account_key'=>$creditH['user_id'],'account_type'=>'saholic'),'recursive'=>-1,'fields'=>'user_id');
|
1179 |
$options = array('conditions'=>array('account_key'=>$creditH['user_id'],'account_type'=>'saholic'),'recursive'=>-1,'fields'=>'user_id');
|
| 1174 |
$userId = $this->UserAccount->find('first',$options);
|
1180 |
$userId = $this->UserAccount->find('first',$options);
|
| 1175 |
$userId = $userId['UserAccount']['user_id'];
|
1181 |
$userId = $userId['UserAccount']['user_id'];
|
| 1176 |
$usersMap[$creditH['user_id']]=$userId;
|
1182 |
$usersMap[$creditH['user_id']]=$userId;
|
| 1177 |
}
|
1183 |
}
|
| 1178 |
}
|
1184 |
}
|
| 1179 |
|
- |
|
| 1180 |
$this->set(compact('creditHistory','usersMap','hasMore','totalCount'));
|
1185 |
$this->set(compact('creditHistory','usersMap','hasMore','totalCount','page'));
|
| 1181 |
}
|
1186 |
}
|
| 1182 |
|
1187 |
|
| 1183 |
public function admin_loanhistory(){
|
1188 |
public function admin_loanhistory(){
|
| 1184 |
$url = Configure::read('saholicapihost').'counter!getLoanHistory?limit=0&offset=0';
|
1189 |
$url = Configure::read('saholicapihost').'counter!getLoanHistory?limit=0&offset=0';
|
| 1185 |
$response = $this->make_request ( $url, null );
|
1190 |
$response = $this->make_request ( $url, null );
|