Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Mail::find();
     // add conditions that should always apply here
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 50], 'sort' => ['defaultOrder' => ['id' => SORT_DESC]]]);
     $this->load($params);
     return $dataProvider;
 }
Esempio n. 2
0
 public function actionIndex()
 {
     Yii::error("RCJ - Esto entro aqui");
     /** @var Mail[] $list */
     $list = Mail::find()->where('status < :ss and created <= :date', [':ss' => Mail::STATUS_ERROR_FATAL, ':date' => date('Y-m-d H:i:s')])->all();
     Yii::error("RCJ - encontro: " . count($list));
     print "Procesing: " . count($list) . " mails\n";
     foreach ($list as $mail) {
         $this->send($mail, Yii::$app->params['adminEmail']);
     }
 }