lucas cardoso
2 years ago
1 changed files with 7 additions and 14 deletions
@ -1,32 +1,25 @@
|
||||
<?php |
||||
|
||||
namespace app\Controllers; |
||||
namespace app\Actions; |
||||
|
||||
use app\Core\Controller; |
||||
use app\Interfaces\IApiMedia; |
||||
use app\Models\SystemMessage; |
||||
use Exception; |
||||
|
||||
/** |
||||
* Description of SupervisorController |
||||
* |
||||
* @author root |
||||
*/ |
||||
class SystemMessageController extends Controller |
||||
class SystemMessageAction |
||||
{ |
||||
/** @var SystemMessage $sysMessage model de mensagens do sistema */ |
||||
protected $sysMessage; |
||||
protected SystemMessage $sysMessage; |
||||
|
||||
public function __construct() |
||||
function __construct() |
||||
{ |
||||
$this->sysMessage = new SystemMessage(); |
||||
} |
||||
public function sendMessageSystem($momento, $variavels, IApiMedia $api, $numero, $fila = null) |
||||
function __invoke($momento, $variavels, IApiMedia $api, $numero, $fila = null) |
||||
{ //$variavels = [["nome" => '@cliente', "valor" => 'afonso']] |
||||
try { |
||||
$msgs = $this->sysMessage->findMessage($momento, $fila); |
||||
$msgs = $this->sysMessage->get(['momento' => $momento, 'fila' => $fila]); |
||||
if (empty($msgs)) { |
||||
$msgs = $this->sysMessage->findMessage($momento); |
||||
$msgs = $this->sysMessage->get(['momento' => $momento]); |
||||
} |
||||
|
||||
foreach ($msgs as $key => $msg) { |
Loading…
Reference in new issue