Arreglando grupos de usuarios

This commit is contained in:
imnavajas
2024-05-03 16:36:02 +02:00
parent 9858616b6e
commit c152cf699d
12 changed files with 186 additions and 198 deletions

View File

@ -5,8 +5,8 @@ namespace App\Controllers;
use App\Models\CronTabModel;
use App\Models\NotificationModel;
use App\Models\Usuarios\UserModel;
use App\Models\Usuarios\UserGroupModel;
use App\Models\Usuarios\GroupUserModel;
use App\Models\Usuarios\GroupModel;
use App\Models\Usuarios\GroupsUsersModel;
use App\Models\ActivityModel;
use CodeIgniter\RESTful\ResourceController;
@ -24,8 +24,8 @@ class Ajax extends ResourceController
function __construct()
{
$this->user_model = new UserModel();
$this->group_model = new UserGroupModel();
$this->group_user_model = new GroupUserModel();
$this->group_model = new GroupModel();
$this->group_user_model = new GroupsUsersModel();
$this->activity_model = new ActivityModel();
$this->crontab_model = new CronTabModel();
$this->notification_model = new NotificationModel();
@ -56,20 +56,20 @@ class Ajax extends ResourceController
//Total number of records without filtering
$totalRecords = $this->user_model->select('id_user')
//->join('auth_user_group','auth_user_group.token = auth_user.group')
//->join('auth_groups','auth_groups.token = auth_user.group')
->countAllResults();
//Total number of records with filtering
$totalRecordwithFilter = $this->user_model->select('id_user')
//->join('auth_user_group','auth_user_group.token = auth_user.group')
//->join('auth_groups','auth_groups.token = auth_user.group')
->orLike('first_name', $searchValue)
->orLike('email', $searchValue)
->countAllResults();
//Fetch records
//$records = $this->user_model->select('auth_user.*,auth_user_group.title')
//$records = $this->user_model->select('auth_user.*,auth_groups.title')
$records = $this->user_model->select('auth_user.*')
//->join('auth_user_group','auth_user_group.token = auth_user.group')
//->join('auth_groups','auth_groups.token = auth_user.group')
->orLike('first_name', $searchValue)
->orLike('email', $searchValue)
->orderBy($columnName,$columnSortOrder)