255], [['project'], 'string', 'max' => 50], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => Yii::t('mole', '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'), 'module' => Yii::t('mole', 'Module'), 'controller' => Yii::t('mole', 'Controller'), 'type' => Yii::t('mole', 'Type'), 'name' => Yii::t('mole', 'Name'), 'params' => Yii::t('mole', 'Params'), 'isReady' => Yii::t('mole', 'Is Ready'), 'completed' => Yii::t('mole', 'Completed'), 'priority' => Yii::t('mole', 'Priority'), 'childsTotalCount' => Yii::t('mole', 'Childs Total Count'), 'childsCompleted' => Yii::t('mole', 'Childs Completed'), 'status' => Yii::t('mole', 'Status'), '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(); } }