Commit 3645a14a authored by Олег Гиммельшпах's avatar Олег Гиммельшпах

Merge branch 'master' of git.task-on.com:ktask/task-on.com

parents 861cb092 6e2149a9
<?php
namespace common\components;
use common\modules\triggers\components\conditions\conditions\CheckPresenceTime;
use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
......@@ -61,6 +62,8 @@ abstract class BaseController extends Controller
public function beforeAction($action)
{
CheckPresenceTime::init()->initScript();
/*if(substr($currentUrl, -1) == '/' && $currentUrl!="/") {
$urlWithoutSlash = substr($currentUrl, 0, -1);
return $this->redirect($urlWithoutSlash,true,301);
......
......@@ -193,10 +193,13 @@ class TriggerTrigger extends \common\components\ActiveRecordModel
/**
* Метод возвращает массив актуальных на данный момент триггеров
* @param $id
* @return array|\yii\db\ActiveRecord[]
*/
public static function getActualTriggers() {
return TriggerTrigger::find()->indexBy('id')->all();
public static function getActualTriggers($id=null) {
return ($id===null)
? TriggerTrigger::find()->indexBy('id')->all()
: TriggerTrigger::find()->joinWith('triggerConditions')->where(['trigger_condition.condition_id' => $id])->all();
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment