public function comment() { parent::isLogin(); //登录判断 $objUser = M('user'); $objAsk = M('ask'); $commentList = parent::getCommentMsg(array('status' => "0", 'reply_uid' => $_SESSION['uid']), 'select'); foreach ($commentList as $k1 => $v1) { $comment_user = $objUser->where('id=' . $v1['comment_uid'])->field('username,face')->find(); $reply_user = $objUser->where('id=' . $v1['reply_uid'])->getField('username'); $commentList[$k1]['comment_user'] = $comment_user['username']; $commentList[$k1]['reply_user'] = $reply_user; $commentList[$k1]['comment_user_face'] = $comment_user['face']; $commentList[$k1]['article_name'] = $objAsk->where('id=' . $v1['aid'])->getField('ask_name'); } $this->assign('commentList', $commentList); $this->answerNumAll = $this->getAnswerNum(); $this->adoptNumAll = $this->getAdoptNum(); $this->display(); }