|
@@ -101,6 +101,9 @@ class EventoController extends Controller {
|
|
|
if ($creado !== false) {
|
|
if ($creado !== false) {
|
|
|
$modelo->creado = $creado->format(\DateTime::RFC3339_EXTENDED);
|
|
$modelo->creado = $creado->format(\DateTime::RFC3339_EXTENDED);
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($data["estatus"] === false) {
|
|
|
|
|
+ $modelo->eliminado = new Expression('now()');
|
|
|
|
|
+ }
|
|
|
$fechaInicio = $this->cambiarFecha($data["fechaInicio"]);
|
|
$fechaInicio = $this->cambiarFecha($data["fechaInicio"]);
|
|
|
if ($fechaInicio !== false) {
|
|
if ($fechaInicio !== false) {
|
|
|
$modelo->fechaInicio = $fechaInicio->format(\DateTime::RFC3339_EXTENDED);
|
|
$modelo->fechaInicio = $fechaInicio->format(\DateTime::RFC3339_EXTENDED);
|
|
@@ -832,7 +835,7 @@ class EventoController extends Controller {
|
|
|
->column();
|
|
->column();
|
|
|
|
|
|
|
|
$totalEventos = count($eventos);
|
|
$totalEventos = count($eventos);
|
|
|
- $this->stdout("{$totalEventos}");
|
|
|
|
|
|
|
+ $this->stdout("{$totalEventos}\n");
|
|
|
if ($totalEventos === 0) {
|
|
if ($totalEventos === 0) {
|
|
|
# ¿Si no hubo eventos en el período de tiempo también hay que avisar?
|
|
# ¿Si no hubo eventos en el período de tiempo también hay que avisar?
|
|
|
return;
|
|
return;
|
|
@@ -1028,7 +1031,9 @@ class EventoController extends Controller {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$dependenciaLider = DependenciaLider::find()
|
|
$dependenciaLider = DependenciaLider::find()
|
|
|
- ->andWhere(["idDependencia" => $id]);
|
|
|
|
|
|
|
+ ->innerJoin('Usuario', '{{Usuario}}.id = {{DependenciaLider}}.[[idUsuario]]')
|
|
|
|
|
+ ->andWhere(["idDependencia" => $id])
|
|
|
|
|
+ ->andWhere(["{{Usuario}}.eliminado" => null]);
|
|
|
|
|
|
|
|
$nombreDependencia = "";
|
|
$nombreDependencia = "";
|
|
|
if (isset($dependencias[$id])) {
|
|
if (isset($dependencias[$id])) {
|
|
@@ -1036,7 +1041,10 @@ class EventoController extends Controller {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
foreach ($dependenciaLider->each() as $lider) {
|
|
foreach ($dependenciaLider->each() as $lider) {
|
|
|
- $usuario = Usuario::findOne($lider["idUsuario"]);
|
|
|
|
|
|
|
+ $usuario = Usuario::find()
|
|
|
|
|
+ ->andWhere(["id" => $lider["idUsuario"]])
|
|
|
|
|
+ ->andWhere(["eliminado" => null])
|
|
|
|
|
+ ->one();
|
|
|
$notificacionUsuario = new NotificacionUsuario();
|
|
$notificacionUsuario = new NotificacionUsuario();
|
|
|
|
|
|
|
|
$notificacionUsuario->idNotificacion = $notificacion->id;
|
|
$notificacionUsuario->idNotificacion = $notificacion->id;
|
|
@@ -1108,6 +1116,7 @@ class EventoController extends Controller {
|
|
|
|
|
|
|
|
//LIDER GLOBAL
|
|
//LIDER GLOBAL
|
|
|
$liderGlobal = Usuario::find()
|
|
$liderGlobal = Usuario::find()
|
|
|
|
|
+ ->andWhere(["eliminado" => null])
|
|
|
->andWhere(["liderGlobal" => true]);
|
|
->andWhere(["liderGlobal" => true]);
|
|
|
|
|
|
|
|
foreach ($liderGlobal->each() as $lider) {
|
|
foreach ($liderGlobal->each() as $lider) {
|