Merge remote-tracking branch 'origin/master'

This commit is contained in:
mkm 2023-02-02 11:56:26 +08:00
commit 98be87856a
12 changed files with 1198 additions and 2 deletions

View File

@ -0,0 +1,182 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 文章投诉
*
* @icon fa fa-circle-o
*/
class Comment extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.comment/index',
'/admin/nk.comment/add',
'/admin/nk.comment/edit',
'/admin/nk.comment/del',
'/admin/nk.comment/read',
];
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
}
/**
* 数据列表
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
// $where['status']=1;
$where = [];
if (isset($params['keywords'])){
// $where[]=['title','like','%'.$params['keywords'].'%'];
}
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
$www['admin_id'] = $this->adminInfo['id'];
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
if ($user_address){
if($user_address['auth_range'] == 1){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_article_comment')
->where($where)
->count();
$list = Db::table('fa_article_comment')
->withAttr('name',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->withAttr('status',function ($value,$data){
if($value == 1){
return '通过';
}else{
return '不通过';
}
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/comment/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$res=Db::table('fa_article_comment')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
$article = Db::table('fa_article')->where('status',1)->field('id,title')->select();
View::assign('editor', get_system_config('other','editor'));
View::assign('users', $this->users);
View::assign('article', $article);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$res=Db::table('fa_article_comment')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_article_comment')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
$article = Db::table('fa_article')->where('status',1)->field('id,title')->select();
View::assign('article', $article);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_article_comment')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
$article = Db::table('fa_article')->where('status',1)->field('id,title')->select();
View::assign('article', $article);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_article_comment')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -0,0 +1,189 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 文章投诉
*
* @icon fa fa-circle-o
*/
class Complaint extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.complaint/index',
'/admin/nk.complaint/add',
'/admin/nk.complaint/edit',
'/admin/nk.complaint/del',
'/admin/nk.complaint/read',
];
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
}
/**
* 数据列表
*/
public function index()
{
if (request()->isAjax()) {
$params= get_params();
$where['status']=1;
if (isset($params['keywords'])){
// $where[]=['title','like','%'.$params['keywords'].'%'];
}
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
$www['admin_id'] = $this->adminInfo['id'];
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
if ($user_address){
if($user_address['auth_range'] == 1){
$where['village'] = $user_address['village_id'];
}elseif ($user_address['auth_range'] == 2){
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}else{
$where['village'] = $user_address['village_id'];
}
}else{
$where['village'] = '';
}
}
$total = Db::table('fa_article_complaint')
->where($where)
->count();
$list = Db::table('fa_article_complaint')
->withAttr('name',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('title',function ($value,$data){
return Db::table('fa_article')->where('id',$data['article_id'])->value('title');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->withAttr('createtime',function ($value,$data){
return date('Y-m-d H:i:s',$data['createtime']);
})
->withAttr('type',function ($value,$data){
if($value == 1){
return '文章';
}elseif($value == 2){
return '朋友圈';
}else{
return '';
}
})
->where($where)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/complaint/index',['url'=>$this->url]);
}
}
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$res=Db::table('fa_article_complaint')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
$article = Db::table('fa_article')->where('status',1)->field('id,title')->select();
View::assign('editor', get_system_config('other','editor'));
View::assign('users', $this->users);
View::assign('article', $article);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$res=Db::table('fa_article_complaint')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_article_complaint')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
$article = Db::table('fa_article')->where('status',1)->field('id,title')->select();
View::assign('article', $article);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_article_complaint')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
$article = Db::table('fa_article')->where('status',1)->field('id,title')->select();
View::assign('article', $article);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_article_complaint')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}
}

View File

@ -0,0 +1,109 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">文章id<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="party_branch" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='article' id='vo'}
<option value="{$vo.id}" >{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">标识<font>*</font></td>
<td colspan="7">
<select name="status" lay-verify="required">
<option value="1" >文章</option>
<option value="2" >朋友圈</option>
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">投诉内容<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea"></textarea>
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.complaint/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,83 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">评论<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" name="content">{$detail.content}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">回复<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" name="reply">{$detail.reply}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="6">
<input type="radio" name="status" value="1" title="通过" {if $detail.status==1} checked {/if}>
<input type="radio" name="status" value="0" title="不通过" {if $detail.status==0} checked {/if}>
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.comment/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,149 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<!-- <form class="layui-form gg-form-bar border-t border-x">-->
<!-- <div class="layui-input-inline" style="width:300px;">-->
<!-- <input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />-->
<!-- </div>-->
<!-- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>-->
<!-- </form>-->
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>-->
</div>
</script>
<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>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '党员列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:100,
},{
field: 'name',
title: '用户',
align: 'center',
width:120,
},{
field: 'article_id',
title: '文章id',
align: 'center',
width:80,
},{
field: 'content',
title: '评论',
align: 'center',
width:300,
},{
field: 'reply',
title: '回复',
align: 'center',
width:200,
},{
field: 'add_time',
title: '评论时间',
align: 'center',
width:150,
},{
field: 'status',
title: '状态',
align: 'center',
width:100,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,41 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">评论<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" name="content" readonly>{$detail.content}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">回复<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" name="reply" readonly>{$detail.reply}</textarea>
</td>
</tr>
<tr>
<td class="layui-td-gray">状态<font>*</font></td>
<td colspan="6">
<input type="radio" name="status" value="1" disabled title="通过" {if $detail.status==1} checked {/if}>
<input type="radio" name="status" value="0" disabled title="不通过" {if $detail.status==0} checked {/if}>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->

View File

@ -0,0 +1,109 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">文章id<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="party_branch" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='article' id='vo'}
<option value="{$vo.id}" >{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">标识<font>*</font></td>
<td colspan="7">
<select name="status" lay-verify="required">
<option value="1" >文章</option>
<option value="2" >朋友圈</option>
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">投诉内容<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea"></textarea>
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.complaint/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,109 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">文章id<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="article_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='article' id='vo'}
<option value="{$vo.id}" {if $detail.article_id==$vo.id} selected {/if}>{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">标识<font>*</font></td>
<td colspan="7">
<select name="type" lay-verify="required">
<option value="1" {if $detail.type==1} selected {/if}>文章</option>
<option value="2" {if $detail.type==2} selected {/if}>朋友圈</option>
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">投诉内容<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" name="content">{$detail.content}</textarea>
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.complaint/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,149 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<!-- <form class="layui-form gg-form-bar border-t border-x">-->
<!-- <div class="layui-input-inline" style="width:300px;">-->
<!-- <input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />-->
<!-- </div>-->
<!-- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>-->
<!-- </form>-->
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>-->
</div>
</script>
<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>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '党员列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:100,
},{
field: 'name',
title: '用户',
align: 'center',
width:120,
},{
field: 'article_id',
title: '文章id',
align: 'center',
width:120,
},{
field: 'title',
title: '标题',
align: 'center',
width:120,
},{
field: 'content',
title: '投诉内容',
align: 'center',
width:300,
},{
field: 'createtime',
title: '投诉时间',
align: 'center',
width:150,
},{
field: 'type',
title: '标识',
align: 'center',
width:150,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,65 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">文章id<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="party_branch" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='article' id='vo'}
<option value="{$vo.id}" {if $detail.article_id==$vo.id} selected {/if}>{$vo.title}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">标识<font>*</font></td>
<td colspan="7">
<select name="status" lay-verify="required" disabled>
<option value="1" {if $detail.status==1} selected {/if}>文章</option>
<option value="2" {if $detail.status==2} selected {/if}>朋友圈</option>
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray">投诉内容<font>*</font></td>
<td colspan="6">
<textarea class="layui-textarea" readonly>{$detail.content}</textarea>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->

View File

@ -1658,7 +1658,7 @@ class Maintainentry extends BaseController
// 获取家庭的人员信息
$res = Db::table('fa_szxc_information_usermsg')->where($map)
->order('id desc')
->field("id,user_id,name,age,gender,family_num,political_outlook,householder_id,is_hz,address_name,family_relation")
->field("id,user_id,name,age,gender,family_num,political_outlook,householder_id,is_hz,address_name,family_relation,phone")
->withAttr('avatar', function ($value, $data) {
return Db::table('fa_user')->where('id', $data['user_id'])->value('avatar');
})

View File

@ -319,12 +319,23 @@ class Village extends BaseController
}
$this->apiSuccess('获取成功', $news);
} else {
// 判断redis
if(JWT_UID){
$name = JWT_UID . $address['village_id'];
$is_zan = Cache::store('redis')->get($name);
if($is_zan){
$news['is_dz'] = 1;
}else{
$news['is_dz'] = 0;
}
}else{
$news['is_dz'] = 0;
}
$news['id'] = $address['village_id'];
$news['title'] = $address_name;
$news['address'] = $address_name;
$news['images'] = ["https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230115/4dc84e69408fef859e8553a5c7091197.jpg"];
$news['info'] = $address_name;
$news['is_dz'] = 0;
$news['area_id'] = $address['area_id'];
$news['street_id'] = $address['street_id'];
$news['village_id'] = $address['village_id'];