作者 sgj
1 个管道 的构建 通过 耗费 2 秒

调整评论顺序

@@ -10,6 +10,7 @@ namespace app\portal\controller; @@ -10,6 +10,7 @@ namespace app\portal\controller;
10 10
11 11
12 use app\portal\model\GroupModel; 12 use app\portal\model\GroupModel;
  13 +use app\user\model\UserModel;
13 use cmf\controller\WeChatBaseController; 14 use cmf\controller\WeChatBaseController;
14 use EasyWeChat\Foundation\Application; 15 use EasyWeChat\Foundation\Application;
15 use think\Log; 16 use think\Log;
@@ -43,6 +44,8 @@ class FriendsController extends WeChatBaseController @@ -43,6 +44,8 @@ class FriendsController extends WeChatBaseController
43 $group_id=input('id'); 44 $group_id=input('id');
44 /*检查权限*/ 45 /*检查权限*/
45 $user_id=cmf_get_current_user_id(); 46 $user_id=cmf_get_current_user_id();
  47 + $User=new UserModel();
  48 + $user=$User->getUser($user_id);
46 $isin=$this->GroupModel->checkUser($user_id,$group_id); 49 $isin=$this->GroupModel->checkUser($user_id,$group_id);
47 if (empty($isin)){ 50 if (empty($isin)){
48 $this->error(); 51 $this->error();
@@ -57,6 +60,7 @@ class FriendsController extends WeChatBaseController @@ -57,6 +60,7 @@ class FriendsController extends WeChatBaseController
57 } 60 }
58 $this->assign('silence',$silence); 61 $this->assign('silence',$silence);
59 $this->assign('info',$info); 62 $this->assign('info',$info);
  63 + $this-> assign('user',$user);
60 $this->assign('group',$group); 64 $this->assign('group',$group);
61 $this->assign('article',$article); 65 $this->assign('article',$article);
62 return $this->fetch(); 66 return $this->fetch();
@@ -237,8 +237,8 @@ @@ -237,8 +237,8 @@
237 if(res.code==1){ 237 if(res.code==1){
238 $('.bottom_box').hide().attr('id',''); 238 $('.bottom_box').hide().attr('id','');
239 $('.'+'comment'+id).append("<div>" + 239 $('.'+'comment'+id).append("<div>" +
240 - " <text class=\"comment_name\">宋医生 :</text>" +  
241 - " <text>1111</text>" + 240 + " <text class=\"comment_name\">{$user_name} :</text>" +
  241 + " <text>"+content+"</text>" +
242 " </div>") 242 " </div>")
243 alert('评论成功'); 243 alert('评论成功');
244 } 244 }