Advertisement
vdp

Untitled

vdp
Jun 26th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. class HistoryModel extends CI_Model{
  4.     public function getHistory($id_user){
  5.       $this->db->where('histories.id_user = '.$id_user.'');
  6.       $this->db->order_by('reported_at','DESC');
  7.       $data = $this->db->get('histories')->result();
  8.       if(count($data)!=0){
  9.         $response['message'] = 'Get Data Success';
  10.         $response['error'] = false;
  11.         $response['data'] = $data;
  12.       }else{
  13.         $response['message'] = 'No History';
  14.         $response['error'] = true;
  15.       }
  16.       return $response;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement