/** * 判断文章是否采集 * @param $url * @return bool */ protected function isGathered($url) { $gather = Gather::find()->where(['url' => md5(trim($url)), 'res' => true])->one(); return $gather ? true : false; }
/** * 判断文章是否采集 * @param $url * @return bool */ public function isGathered($url) { $gather = Gather::find()->where(['url' => md5(trim($url)), 'res' => 1])->one(); return $gather ? 1 : 0; }
/** * Lists all Gather models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Gather::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }