first commit
This commit is contained in:
68
application/models/admin/admin_member/m_admin_member.php
Executable file
68
application/models/admin/admin_member/m_admin_member.php
Executable file
@@ -0,0 +1,68 @@
|
||||
<?
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class m_admin_member extends CI_Model{
|
||||
|
||||
// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
|
||||
$this->load->database();
|
||||
$this->load->library('session');
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : 회원 수정
|
||||
# CREATE : 2018-02-19
|
||||
#---------------------------------------------------------------------------
|
||||
function member_edit_proc($req_data){
|
||||
|
||||
# request
|
||||
$org_user_pwd = $req_data['org_user_pwd'];
|
||||
$user_id = $this->session->userdata('Adm_Id');
|
||||
|
||||
$sql1 = "select * from admin where is_del = 'N' and user_id ='".$user_id."' and user_pwd = MD5('".$org_user_pwd."')";
|
||||
$res1 = $this->db->query($sql1);
|
||||
$row1 = $res1->row();
|
||||
|
||||
$array = json_decode(json_encode($row1), true);
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : 비밀번호 수정
|
||||
# CREATE : 2018-02-19
|
||||
#---------------------------------------------------------------------------
|
||||
function member_passwd_update($req_data){
|
||||
# request
|
||||
$new_user_pwd = $req_data['new_user_pwd'];
|
||||
$user_id = $this->session->userdata('Adm_Id');
|
||||
|
||||
$sql1 = "update admin
|
||||
set user_pwd = MD5('".$new_user_pwd."')
|
||||
where is_del = 'N' and user_id ='".$user_id."'";
|
||||
$this->db->query($sql1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : admin where user_id count
|
||||
# CREATE : 2018-03-14
|
||||
#---------------------------------------------------------------------------
|
||||
function admin_where_partner_id_count($req_data){
|
||||
# request
|
||||
$user_id = $req_data;
|
||||
|
||||
$this->db->where('user_id', $user_id);
|
||||
$this->db->from('admin');
|
||||
$row = $this->db->count_all_results();
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
76
application/models/admin/admin_member/m_login.php
Executable file
76
application/models/admin/admin_member/m_login.php
Executable file
@@ -0,0 +1,76 @@
|
||||
<?
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class m_login extends CI_Model{
|
||||
|
||||
// 생성자, 해당 모델이 생성될때 항상 실행되는 초기화작업
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
|
||||
$this->load->database();
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : 어드민 로그인 실핼
|
||||
# CREATE : 2018-02-18
|
||||
#---------------------------------------------------------------------------
|
||||
function login_proc($req_data){
|
||||
|
||||
# request
|
||||
$user_id = $req_data['user_id'];
|
||||
$user_pwd = $req_data['user_pwd'];
|
||||
|
||||
$sql1 = "select idx, user_id, user_name, last_login_date, '0' as member_group_idx from admin where is_del = 'N' and user_id ='".$user_id."' and user_pwd = MD5('".$user_pwd."')";
|
||||
$res1 = $this->db->query($sql1);
|
||||
$row1 = $res1->row();
|
||||
|
||||
$array = json_decode(json_encode($row1), true);
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : 마지막 로그인 업데이트
|
||||
# CREATE : 2018-02-18
|
||||
#---------------------------------------------------------------------------
|
||||
function last_login_update($req_data){
|
||||
# request
|
||||
$idx = $req_data['idx'];
|
||||
$tb = $req_data['tb'];
|
||||
|
||||
$now_date = date("Y-m-d H:i:s");
|
||||
|
||||
$update_data = array();
|
||||
$update_data['last_login_date'] = $now_date;
|
||||
|
||||
$this->db->where('idx', $idx);
|
||||
$row = $this->db->update($tb, $update_data);
|
||||
|
||||
return $row;
|
||||
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PURPOSE : 파트너 어드민 로그인 실핼
|
||||
# CREATE : 2018-02-28
|
||||
#---------------------------------------------------------------------------
|
||||
function partner_login_proc($req_data){
|
||||
# request
|
||||
$user_id = $req_data['user_id'];
|
||||
$user_pwd = $req_data['user_pwd'];
|
||||
|
||||
$sql1 = "select idx, partner_id as user_id, partner_name as user_name, last_login_date, member_group_idx from partner where is_del = 'N' and partner_id ='".$user_id."' and partner_pwd = MD5('".$user_pwd."')";
|
||||
$res1 = $this->db->query($sql1);
|
||||
$row1 = $res1->row();
|
||||
|
||||
$array = json_decode(json_encode($row1), true);
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user