'http','message'=>'请输入正确的地址'], ]; } public function attributeLabels() { return [ 'url'=>'地址', ]; } public function Authenticator($input) { $this->load($input,''); if(!$this->validate()) return $this->errors; return $this; } public function FindById($id) { return self::findOne($id); } public function getList($input) { $query = self::find(); $query->select(['url','id','img','create_at','is_show']); $query->andWhere(['del'=>$this->setDel]); if(!empty($input['page'])) { $query->limit = $input['limit']; $query->offset = ($input['page']-1 )* $input['limit']; } return $query->orderBy(['create_at'=>SORT_DESC])->asArray()->all(); } public function WhereColumn($query) { } public function Total() { $query = self::find(); $query->andWhere(['del'=>$this->setDel]); return $query->count(); } public function Oneinfo() { $query = self::find(); $query->select(['img','url']); $query->andWhere(['del'=>$this->setDel]); $query->andWhere(['is_show'=>1]); $query->limit = 1; return $query->asArray()->one(); } }