Continuo migrando, estoy perfilando activity y los settings

This commit is contained in:
imnavajas
2024-05-01 22:13:00 +02:00
parent dce9e08cf6
commit 54de3402f3
62 changed files with 698 additions and 425 deletions

View File

@ -37,7 +37,7 @@ class BaseController extends Controller
*
* @var array
*/
protected $helpers = ['general','jwt'];
protected $helpers = ['general', 'go_common'];
/**
* Constructor.
@ -57,24 +57,7 @@ class BaseController extends Controller
$language->setLocale($session->lang);
// Set TimeZone
if(empty($session->get('settings'))){
$settingsModel = new SettingsModel();
$settings = $settingsModel->select('default_timezone')->first()??[];
date_default_timezone_set($settings['default_timezone']??'America/Sao_Paulo');
}else{
date_default_timezone_set($session->get('settings')['default_timezone']??'America/Sao_Paulo');
}
date_default_timezone_set('Europe/Madrid');
// Get notification
if(!empty($session->get('token'))) {
$notificationModel = new NotificationModel();
$pulse = $notificationModel->where('user_recipient',$session->get('token'))->where('is_read',false)->countAllResults() ?? 0;
$notification = $notificationModel->select('token,title,is_read,created_at')->where('user_recipient',$session->get('token'))->orderBy('created_at','desc')->findAll(5) ?? [];
$session->set('notification', $notification);
$session->set('pulse', $pulse);
}else{
$session->set('notification', []);
$session->set('pulse', 0);
}
}
}