作者 xiaohu thinkpad

评价问题重构

@@ -75,10 +75,12 @@ class CommentController extends UserBaseController @@ -75,10 +75,12 @@ class CommentController extends UserBaseController
75 $yuyue_data = Db::name('yuyue') 75 $yuyue_data = Db::name('yuyue')
76 ->alias('yy') 76 ->alias('yy')
77 ->join('qnb_user qu','qu.id = yy .teach_id') 77 ->join('qnb_user qu','qu.id = yy .teach_id')
78 - ->field('yy.*,qu.user_nickname,qu.headimgurl,qu.kemu') 78 + ->field('yy.*,qu.user_nickname,qu.headimgurl')
79 ->where(['yy.id'=>$id]) 79 ->where(['yy.id'=>$id])
80 ->find(); 80 ->find();
81 $teach_id = $yuyue_data['teach_id']; 81 $teach_id = $yuyue_data['teach_id'];
  82 + $kemu = Db::name('user')->where(['id'=>$yuyue_data['uid']])->value('kemu');
  83 + $yuyue_data['kemu'] = $kemu;
82 //获取标签 84 //获取标签
83 $rre = Db::name('commente')->where(['teach_id'=>$teach_id])->find(); 85 $rre = Db::name('commente')->where(['teach_id'=>$teach_id])->find();
84 $rree = Db::name('commente_tag')->where(['id'=>['in',$rre['comment_tag']]])->field('name')->select()->toArray(); 86 $rree = Db::name('commente_tag')->where(['id'=>['in',$rre['comment_tag']]])->field('name')->select()->toArray();