示例#1
0
 private function updateAll()
 {
     $searchModel = new AtcinfoSearch();
     $dataProvider = $searchModel->getWorked();
     $atcinfos = $dataProvider->getModels();
     $saver = new dbConnector\CdrSaver();
     foreach ($atcinfos as $atc) {
         $mLoader = new dbConnector\CdrLoader($atc);
         $connection_result = $mLoader->connect();
         if ($connection_result) {
             $saver->beginSave($atc);
             do {
                 $cdr = $mLoader->listCdr();
                 if ($cdr[0] != false) {
                     $saver->save($cdr[0]);
                 }
             } while ($cdr[1] == true);
             $saver->endSave();
         } else {
             echo $connection_result;
         }
     }
 }
示例#2
0
 /**
  * Lists all Atcinfo models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new AtcinfoSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }