bbone/application/modules/User/models/User_model.php
suseendhiran17 a159682e2f suseendhiran
2022-12-30 11:06:36 +05:30

39 lines
1.0 KiB
PHP

<?php
class User_model extends MY_Model {
public function get_user($business_id)
{
$this->db->select('*');
$this->db->from('users');
$this->db->where('business_id', $business_id);
// $this->db->where('role', 'admin');
// $this->db->where('role', 'user');
// $this->db->where('is_active', 1);
$query = $this->db->get();
$query = $query->result();
return $query;
}
public function get_asset_by_md5_id($id,$business_id)
{
$this->db->select('*');
$this->db->from('users');
$this->db->where('business_id', $business_id);
$this->db->where('md5(id)', $id);
$query = $this->db->get();
$query = $query->row();
return $query;
}
public function delete_asset_by_md5_id($id,$business_id)
{
$this->db->where('md5(id)', $id);
$this->db->where('business_id', $business_id);
$this->db->where('role', 'user');
$this->db->set('is_active',0);
$this->db->update('users');
return;
}
}