mirror of
https://github.com/dyzulk/dyzulk-apps.git
synced 2026-01-26 21:32:04 +07:00
pertama commit
This commit is contained in:
29
application/models/UserModel.php
Normal file
29
application/models/UserModel.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class UserModel extends CI_Model
|
||||
{
|
||||
|
||||
public function getUsers(){
|
||||
$query = $this->db->get('users_account');
|
||||
return $query->result_array();
|
||||
}
|
||||
|
||||
public function getTotalUsers() {
|
||||
$query = $this->db->query("SELECT COUNT(*) AS total_users FROM users_account");
|
||||
return $query->row()->total_users;
|
||||
}
|
||||
|
||||
public function getTotalAmount() {
|
||||
$query = $this->db->query("SELECT SUM(amount) AS total_amount FROM user_transaction");
|
||||
return $query->row()->total_amount;
|
||||
}
|
||||
|
||||
public function getTotalOnlineUsers() {
|
||||
$this->db->select('COUNT(*) as total_online_users');
|
||||
$this->db->where('status_login', 'online');
|
||||
$query = $this->db->get('users_account');
|
||||
return $query->row()->total_online_users;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user