fix
This commit is contained in:
parent
19444853cf
commit
277ef0beb2
|
@ -126,6 +126,14 @@ class MoleTask extends \yii\db\ActiveRecord
|
||||||
*/
|
*/
|
||||||
public static function add($controller, $name, $params = array(), $priority = 0, $period = 0, $dateAdd = false, $project = false)
|
public static function add($controller, $name, $params = array(), $priority = 0, $period = 0, $dateAdd = false, $project = false)
|
||||||
{
|
{
|
||||||
|
$module = '';
|
||||||
|
if(stripos($model->controller, '.'))
|
||||||
|
{
|
||||||
|
$arController = explode('.', $controller);
|
||||||
|
$module = $arController[0];
|
||||||
|
$controller = $arController[1];
|
||||||
|
}
|
||||||
|
|
||||||
$model = new MoleTask();
|
$model = new MoleTask();
|
||||||
$model->controller = $controller;
|
$model->controller = $controller;
|
||||||
$model->name = $name;
|
$model->name = $name;
|
||||||
|
@ -134,7 +142,8 @@ class MoleTask extends \yii\db\ActiveRecord
|
||||||
$model->period = $period;
|
$model->period = $period;
|
||||||
$model->dateAdd = $dateAdd ?: date('Y-m-d H:i:s');
|
$model->dateAdd = $dateAdd ?: date('Y-m-d H:i:s');
|
||||||
$model->project = $project ?: Yii::$app->getModule('cron')->project;
|
$model->project = $project ?: Yii::$app->getModule('cron')->project;
|
||||||
$model->type = stripos($model->controller, '.') ? $model->controller : ($model->project . '.' . $model->controller); // для совместимости
|
$model->module = $module;
|
||||||
|
$model->type = stripos($controller, '.') ? $controller : ($model->project . '.' . $model->controller); // для совместимости
|
||||||
return $model->save();
|
return $model->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue