Commit 46487d0d by Jansa Jose

J : Change in wallet Transaction History

parent dbde8aeb
......@@ -2201,10 +2201,10 @@ class Webservice_model extends CI_Model {
if(!empty($result) && !empty($result = $result->result_array())){
$res = array('status'=>'success','data'=>$result);
} else {
$res = array('status'=>'error','message'=>'No Data Found','code'=>'ER12');
$res = array('status'=>'error','message'=>'No Users Found','code'=>'ER12');
}
}else{
$res = array('status'=>'error','message'=>'Invalid User','code'=>'ER10');
$res = array('status'=>'error','message'=>'User Authentication Error','code'=>'ER10');
}
}catch(Exception $e){
$res = array('status'=>'error','message'=>'Ohh No!! Something Went South','code'=>'ER08');
......@@ -2229,7 +2229,7 @@ class Webservice_model extends CI_Model {
$res = array('status'=>'error','message'=>'User Authentication Error','code'=>'ER10');
}
}catch(Exception $e){
$res = array('status'=>'error','message'=>'Ohh No!! Something Went South','code'=>'ER08');
$res = array('status'=>'error','message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
}
return $res;
}
......@@ -2248,10 +2248,14 @@ class Webservice_model extends CI_Model {
$meta = array('total_pages'=>ceil($count/$perPage),'total_items'=>$count,
'current_page'=>$page,'items_per_page'=>$perPage);
$sql = "SELECT transaction_code AS transaction_number,amount,transaction_type,created_date,status FROM wallet_transactions WHERE customer_id='$user_id' LIMIT $limit,$perPage";
$sql = "SELECT transaction_code AS transaction_number,amount,transaction_type,created_date,status
FROM wallet_transactions
WHERE customer_id='$user_id'
ORDER BY id DESC
LIMIT $limit,$perPage";
$query = $this->db->query($sql);
if(empty($query) || empty($walletHistory = $query->result_array())){
$res = array('status'=>'error','message'=>'No History Found','code'=>'ER13');
$res = array('status'=>'error','message'=>'No Transaction History Found','code'=>'ER13');
return $res;
}
foreach($walletHistory AS $walletKey => $walletValue){
......@@ -2259,13 +2263,13 @@ class Webservice_model extends CI_Model {
}
$res = array('status'=>'success','data'=>array('wallet'=>$walletHistory,'meta'=>$meta));
} else{
$res = array('status'=>'error','message'=>'No Data found','code'=>'ER10');
$res = array('status'=>'error','message'=>'No Transaction History Found','code'=>'ER10');
}
}else{
$res = array('status'=>'error','message'=>'User authentication Error','code'=>'ER10');
$res = array('status'=>'error','message'=>'User Authentication Error','code'=>'ER10');
}
}catch(Exception $e){
$res = array('status'=>'error','message'=>'Ohh No!! Something Went South','code'=>'ER08');
$res = array('status'=>'error','message'=>'Ohh No!! Something Went South!!','code'=>'ER08');
}
return $res;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment