Пример #1
0
 /**
  * Finds the Gather model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Gather the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Gather::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #2
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();
 }
Пример #3
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);
 }