'{attribute}不能为空'], ['reply_content','string','max'=>200], ['label','in','range'=>[1,2]], ['label','integer','max'=>1], ]; } public function attributeLabels() { return [ 'cid'=>'点评', 'reply_content'=>'点评内容', 'label'=>'标签' ]; } public function FindById($id) { return self::findOne($id); } public function getCommentReply($comment_id){ $query = self::find(); $row = $query->andWhere(['cid' => $comment_id])->orderBy(['create_at'=>SORT_DESC])->one(); if(!empty($row)){ return $row['reply_content']; } return null; } }