コード例 #1
0
ファイル: ArticleSpider.php プロジェクト: specialnote/myYii
 /**
  * 判断文章是否采集
  * @param $url
  * @return bool
  */
 protected function isGathered($url)
 {
     $gather = Gather::find()->where(['url' => md5(trim($url)), 'res' => true])->one();
     return $gather ? true : false;
 }
コード例 #2
0
ファイル: SpiderAbstract.php プロジェクト: zhangsong/yii
 /**
  * 判断文章是否采集
  * @param $url
  * @return bool
  */
 public function isGathered($url)
 {
     $gather = Gather::find()->where(['url' => md5(trim($url)), 'res' => 1])->one();
     return $gather ? 1 : 0;
 }
コード例 #3
0
 /**
  * Lists all Gather models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Gather::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }