示例#1
0
 /**
  * Creates a new Gather model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Gather();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
示例#2
0
 /**
  * 采集日志
  * @param $url
  * @param $category
  * @param $res
  * @param $result
  */
 public function addLog($url, $category, $res, $result)
 {
     $gather = new Gather();
     $gather->name = $this->config['name'];
     $gather->category = $category;
     $gather->url = md5($url);
     $gather->url_org = $url;
     $gather->res = $res;
     $gather->result = $result;
     $gather->save(false);
 }
示例#3
0
 /**
  * 采集日志
  * @param $url
  * @param $category
  * @param $res
  * @param $result
  */
 public function addLog($url, $category, $res, $result, $date = '')
 {
     $gather = new Gather();
     $gather->name = $this->name;
     $gather->category = $category;
     $gather->url = md5($url);
     $gather->url_org = $url;
     $gather->res = $res;
     $gather->result = $result;
     $gather->save();
 }