更新后台评论按钮权限

This commit is contained in:
monanxiao 2023-03-21 17:30:55 +08:00
parent 7ba6586b82
commit 46eb8fdbdd
2 changed files with 15 additions and 3 deletions

View File

@ -66,6 +66,7 @@ class Comment extends BaseController
$total = Db::table('fa_article_comment') $total = Db::table('fa_article_comment')
->where($where) ->where($where)
->count(); ->count();
$list = Db::table('fa_article_comment') $list = Db::table('fa_article_comment')
->withAttr('name',function ($value,$data){ ->withAttr('name',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name'); return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
@ -79,8 +80,10 @@ class Comment extends BaseController
->withAttr('status',function ($value,$data){ ->withAttr('status',function ($value,$data){
if($value == 1){ if($value == 1){
return '通过'; return '通过';
}else{ }elseif($value == 2){
return '不通过'; return '不通过';
}else{
return '待审核';
} }
}) })
->where($where) ->where($where)
@ -92,6 +95,7 @@ class Comment extends BaseController
return table_assign(0, '', $result); return table_assign(0, '', $result);
} }
else{ else{
return view('nk/comment/index',['url'=>$this->url]); return view('nk/comment/index',['url'=>$this->url]);
} }
} }

View File

@ -26,7 +26,15 @@
</script> </script>
<script type="text/html" id="barDemo"> <script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div> <div class="layui-btn-group">
{if {:session('gougu_admin')['group_access']==1}
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
{/if}
<a class="layui-btn layui-btn-xs {{# if(d.status == '待审核'){ }}{{# } else { }}layui-hide{{# } }}" lay-event="edit">审核</a>
</div>
</script> </script>
{/block} {/block}