| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/mmobot/app/modules/api/models/ |
Upload File : |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class api_model extends MY_Model {
public $tb_users;
public $tb_categories;
public $tb_services;
public $tb_orders;
public function __construct(){
$this->tb_categories = CATEGORIES;
$this->tb_services = SERVICES;
$this->tb_orders = ORDER;
parent::__construct();
}
function get_services_list(){
$data = array();
$this->db->select("s.id as service, s.name, c.name as category, s.price as rate, s.min, s.max, s.type, s.desc, s.dripfeed");
$this->db->from($this->tb_services ." s");
$this->db->join($this->tb_categories." c", "s.cate_id = c.id", 'left');
$this->db->where("s.status", "1");
$this->db->where("c.status", "1");
$query = $this->db->get();
if($query->result()){
return $data = $query->result();
}else{
false;
}
}
function get_order_id($id, $uid){
$this->db->select("id as order, status, charge, start_counter as start_count, remains");
$this->db->from($this->tb_orders);
$this->db->where("id", $id);
$this->db->where("uid", $uid);
$query = $this->db->get();
$result = $query->row();
if(!empty($result)){
switch ($result->status) {
case 'completed':
$result->status = 'Completed';
break;
case 'completed':
$result->status = 'Completed';
break;
case 'processing':
$result->status = 'Processing';
break;
case 'pending':
$result->status = 'Pending';
break;
case 'inprogress':
$result->status = 'In progress';
break;
case 'partial':
$result->status = 'Partial';
break;
case 'cancelled':
$result->status = 'Cancelled';
break;
case 'refunded':
$result->status = 'Refunded';
break;
}
return $result;
}
return false;
}
}