123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace backend\models;
- /**
- * worker
- * Class WorkerScript
- * @package backend\models
- */
- class WorkerScript extends \yii\db\ActiveRecord
- {
- const STATUS_RUN = 1;
- const STATUS_STOP = 0;
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%worker_script}}';
- }
- /**
- * [所有需要运行的脚本]
- * @author: libingke
- * @return array|\yii\db\ActiveRecord[]
- */
- public static function getRunScriptList()
- {
- $data = self::find()
- ->where(['status' => static::STATUS_RUN])
- ->asArray()->all();
- return $data;
- }
- }
|