diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 01c637a..6d906a6 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -22,16 +22,12 @@ $routes->get('/home', 'Home\Home::dashboard'); */ $routes->group('board', ['namespace' => 'App\Controllers\Board'], function ($routes) { - // /board/notice/lists + /** + * 공지사항 + */ $routes->get('notice/lists', 'Notice::notice'); - - // /board/notice/detail/(:num) $routes->get('notice/detail/(:num)', 'Notice::detail/$1'); - - // /board/notice/write $routes->get('notice/write', 'Notice::write'); - - // /board/notice/modify/(:num) $routes->get('notice/modify/(:num)', 'Notice::modify/$1'); // API @@ -66,6 +62,7 @@ $routes->group('manage', ['namespace' => 'App\Controllers\Manage'], function ($r $routes->post('user/save', 'User::saveUser'); $routes->post('user/remove', 'User::removeUser'); $routes->get('user/excel', 'User::excel'); + $routes->post('user/saveSms', 'User::saveSms'); /** API - 조직관리 */ $routes->get('dept/getDeptList', 'Dept::getDeptList'); diff --git a/app/Controllers/manage/User.php b/app/Controllers/manage/User.php index 6cbc138..cae6870 100644 --- a/app/Controllers/manage/User.php +++ b/app/Controllers/manage/User.php @@ -155,6 +155,30 @@ class User extends BaseController } } + + // SMS 인증여부 일괄저장 + public function saveSms() + { + try { + + $useYn = $this->request->getPost('useYn') ?: 'Y'; + + // UPDATE users + $this->userModel->updateUserSmsYn($useYn); + + return $this->response->setJSON([ + 'code' => '0', + 'msg' => 'success' + ]); + + } catch (\Exception $e) { + return $this->response->setJSON([ + 'code' => '9', + 'msg' => $e->getMessage(), + ]); + } + } + // 엑셀다운로드 public function excel() { diff --git a/app/Models/manage/UserModel.php b/app/Models/manage/UserModel.php index 3394a8a..f21520e 100644 --- a/app/Models/manage/UserModel.php +++ b/app/Models/manage/UserModel.php @@ -349,6 +349,28 @@ class UserModel extends Model ]; } + // 유저 SMS 인증정보 일괄 수정 + public function updateUserSmsYn($useYn) + { + $sql = "UPDATE users + SET sms_auth_yn = {$useYn}} + WHERE use_yn = 'Y' "; + + $this->db->query($sql); + + if ($this->db->transStatus() === false) { + return [ + 'success' => false, + 'msg' => '저장실패', + ]; + } + + // 성공 + return [ + 'success' => true, + ]; + } + // 엑셀 다운로드 조회 public function getExcelUserList($data) { diff --git a/app/Views/pages/manage/dept/lists.php b/app/Views/pages/manage/dept/lists.php index 84c3553..886c0d1 100644 --- a/app/Views/pages/manage/dept/lists.php +++ b/app/Views/pages/manage/dept/lists.php @@ -13,6 +13,11 @@ .blockUI { z-index: 1500 !important; } + + .swal2-cancel { + background-color: #ff0000 !important; + color: #fff !important; + }