'{attribute}不能为空'], ['ip','ip'], [['del'],'in','range'=>[1,2],'message'=>'请输入正确的信息'], ]; } public function Total() { return self::find()->andWhere(['del'=>1])->andFilterWhere(['hid'=>$this->hid])->andFilterWhere(['hcid'=>$this->hcid])->count(); } public function FindById($id) { return self::findOne($id); } //Ip 限制 public function Iplimit($input) { $total = self::find()->andWhere(['del'=>1,'hid'=>$input['hid'],'hcid'=>$input['hcid'],'ip'=>$input['ip']])->count(); if($total >=1){ return false; } return true; } }