36867 Интеграция с модерацией, реализация cron-task
This commit is contained in:
@@ -41,7 +41,7 @@ class MoleTask extends \yii\db\ActiveRecord
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['parentId', 'isReady', 'childsTotalCount', 'childsCompleted', 'status'], 'required'],
|
||||
//[['parentId', 'isReady', 'childsTotalCount', 'childsCompleted', 'status'], 'required'],
|
||||
[['parentId', 'isReady', 'completed', 'priority', 'childsTotalCount', 'childsCompleted'], 'integer'],
|
||||
[['dateAdd', 'dateStart', 'dateEnd'], 'safe'],
|
||||
[['params'], 'string'],
|
||||
@@ -57,7 +57,7 @@ class MoleTask extends \yii\db\ActiveRecord
|
||||
{
|
||||
return [
|
||||
'id' => Yii::t('mole', 'ID'),
|
||||
/* 'parentId' => Yii::t('mole', 'Parent ID'),
|
||||
'parentId' => Yii::t('mole', 'Parent ID'),
|
||||
'dateAdd' => Yii::t('mole', 'Date Add'),
|
||||
'dateStart' => Yii::t('mole', 'Date Start'),
|
||||
'dateEnd' => Yii::t('mole', 'Date End'),
|
||||
@@ -72,7 +72,23 @@ class MoleTask extends \yii\db\ActiveRecord
|
||||
'childsTotalCount' => Yii::t('mole', 'Childs Total Count'),
|
||||
'childsCompleted' => Yii::t('mole', 'Childs Completed'),
|
||||
'status' => Yii::t('mole', 'Status'),
|
||||
'project' => Yii::t('mole', 'Project'),*/
|
||||
'project' => Yii::t('mole', 'Project'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Выбираем все строки с project
|
||||
*/
|
||||
public function getAllTask()
|
||||
{
|
||||
return self::find()
|
||||
->andWhere([
|
||||
'project'=> Yii::$app->getModule('cron')->project,
|
||||
'completed' => 0,
|
||||
])
|
||||
->andWhere(['IS', 'dateStart', NULL])
|
||||
->andWhere(['IS', 'dateEnd', NULL])
|
||||
// ->andWhere(['<=', 'dateAdd', date('Y-m-d H:i:s')])
|
||||
->all();
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ class MoleTaskSearch extends MoleTask
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['parentId', 'isReady', 'completed', 'priority', 'childsTotalCount', 'childsCompleted'], 'integer'],
|
||||
[['id', 'parentId', 'isReady', 'completed', 'priority', 'childsTotalCount', 'childsCompleted'], 'integer'],
|
||||
[['dateAdd', 'dateStart', 'dateEnd'], 'safe'],
|
||||
[['params'], 'string'],
|
||||
[['module', 'controller', 'type', 'name', 'status'], 'string', 'max' => 255],
|
||||
|
Reference in New Issue
Block a user