mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Continuo migrando, estoy perfilando activity y los settings
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user