diff --git a/app/admin/controller/community/Organ.php b/app/admin/controller/community/Organ.php index a9a713b..ad0e4b3 100644 --- a/app/admin/controller/community/Organ.php +++ b/app/admin/controller/community/Organ.php @@ -4,11 +4,13 @@ namespace app\admin\controller\community; +use app\admin\logic\community\CommunityArticleLogic; use app\admin\logic\community\OrganTeamLogic; use app\admin\logic\content\HelpCategoryLogic; use app\admin\logic\content\HelpLogic; use app\admin\logic\content\ResourceCategoryLogic; use app\admin\logic\content\ResourceLogic; +use app\admin\validate\community\CommunityArticleValidate; use app\admin\validate\content\HelpValidate; use app\common\basics\AdminBase; use app\common\server\JsonServer; @@ -116,4 +118,28 @@ class Organ extends AdminBase return JsonServer::success('异常'); } + + /** + * @notes 审核文章 + * @return \think\response\Json|\think\response\View + * @author 段誉 + * @date 2022/5/10 17:45 + */ + public function audit() + { + if ($this->request->isAjax()) { + $post = $this->request->post(); + $result = OrganTeamLogic::audit($post); + if (false === $result) { + return JsonServer::error(OrganTeamLogic::getError() ?: '操作失败'); + } + return JsonServer::success('编辑成功'); + } + $id = $this->request->get('id'); + return view('', [ + 'detail' => OrganTeamLogic::detail($id) + ]); + } + + } \ No newline at end of file diff --git a/app/admin/controller/setting/Basic.php b/app/admin/controller/setting/Basic.php index 4aa54e4..4c37732 100644 --- a/app/admin/controller/setting/Basic.php +++ b/app/admin/controller/setting/Basic.php @@ -247,4 +247,31 @@ class Basic extends AdminBase } + /** + * Notes: 帮助中心 + * @author 段誉(2021/6/11 0:41) + * @return mixed + */ + public function help() + { + $config = [ + 'documents' => ConfigServer::get('help', 'documents'), + 'train' => ConfigServer::get('help', 'train'), + 'consult' => ConfigServer::get('help', 'consult'), + ]; + return view('', ['config' => $config]); + } + + public function setHelp() + { + $post = $this->request->post(); + if ($post) { + ConfigServer::set('help', 'documents', $post['documents']); + ConfigServer::set('help', 'train', $post['train']); + ConfigServer::set('help', 'consult', $post['consult']); + return JsonServer::success('修改成功'); + } + } + + } \ No newline at end of file diff --git a/app/admin/logic/community/OrganTeamLogic.php b/app/admin/logic/community/OrganTeamLogic.php index d338fec..618b59b 100644 --- a/app/admin/logic/community/OrganTeamLogic.php +++ b/app/admin/logic/community/OrganTeamLogic.php @@ -5,12 +5,17 @@ namespace app\admin\logic\community; use app\common\basics\Logic; +use app\common\logic\CommunityArticleLogic as CommonArticleLogic; +use app\common\model\community\CommunityArticle; use app\common\model\community\OrganTeam; +use app\common\model\complain\Complain; use app\common\model\content\Help; use app\common\model\content\Resource; +use app\common\model\user\User; use app\common\server\AreaServer; use app\common\server\UrlServer; use Exception; +use think\facade\Db; class OrganTeamLogic extends Logic { @@ -27,13 +32,24 @@ class OrganTeamLogic extends Logic ]; $where[] = ['type', '=', $type]; - if (!empty($get['name']) and $get['name']) + if (!empty($get['name']) && $get['name']) $where[] = ['name', 'like', '%'.$get['name'].'%']; + + if (isset($get['audit_status']) && $get['audit_status']!=""){ + $where[] = ['audit_status','=',intval($get['audit_status'])]; + } + + + if (isset($get['uid'])){ + $where[] = ['uid','=',intval($get['uid'])]; + } + $model = new OrganTeam(); $lists = $model->field(true) ->where($where) ->order('sort', 'asc') + ->order('id', 'desc') ->paginate([ 'page' => $get['page'], 'list_rows' => $get['limit'], @@ -47,6 +63,17 @@ class OrganTeamLogic extends Logic $item['province_id'], $item['city_id'], ]):''; + $item['username'] = "系统后台"; + $item['mobile'] = ""; + if($item['uid']>0){ + $model = new User(); + $user = $model->findOrEmpty($item['uid']); + if($user){ + $item['username'] = $user['nickname']; + $item['mobile'] = $user['mobile']; + } + + } } return ['count'=>$lists['total'], 'lists'=>$lists['data']]; @@ -69,6 +96,10 @@ class OrganTeamLogic extends Logic $model = new OrganTeam(); $detail = $model->field(true)->findOrEmpty($id)->toArray(); // $detail['path'] = UrlServer::getFileUrl($detail['path']); + $detail['address'] = $detail['province_id']?AreaServer::getAddress([ + $detail['province_id'], + $detail['city_id'], + ]):''; return $detail; } @@ -78,11 +109,11 @@ class OrganTeamLogic extends Logic * @param $post * @return bool */ - public static function add($post) + public static function add($post,$uid=0) { try { OrganTeam::create([ - + 'uid' => $uid, 'name' => $post['name'], 'image' => $post['image'] ?? '', 'intro' => $post['intro'] ?? '', @@ -94,8 +125,9 @@ class OrganTeamLogic extends Logic 'visit' => 0, 'contact' => $post['contact'] ?? '', 'sort' => $post['sort'] ?? 0, - 'is_show' => $post['is_show'], + 'is_show' => $post['is_show']??0, 'company' => $post['company'] ?? '', + 'audit_status' =>$post['audit_status'] ?? 1, ]); return true; @@ -111,10 +143,11 @@ class OrganTeamLogic extends Logic * @param $post * @return bool */ - public static function edit($post) + public static function edit($post,$uid=0) { try { OrganTeam::update([ + 'uid' => $uid, 'name' => $post['name'], 'image' => $post['image'] ?? '', 'intro' => $post['intro'] ?? '', @@ -127,7 +160,8 @@ class OrganTeamLogic extends Logic 'visit' => 0, 'contact' => $post['contact'] ?? '', 'sort' => $post['sort'] ?? 0, - 'is_show' => $post['is_show'] + 'is_show' => $post['is_show']??0, + 'audit_status' =>$post['audit_status'] ?? 1, ], ['id'=>$post['id']]); return true; @@ -181,4 +215,65 @@ class OrganTeamLogic extends Logic return false; } } + + + //获取用户投诉列表 + public static function getUserOrgan($get,$user_id) + { + try { + $model = new OrganTeam(); + $lists = $model->field('*') + ->order('id', 'desc') + ->where([ + ['uid', '=', $user_id], + ['del', '=', 0] + ]) + ->page($get['page_no'], $get['page_size']) + ->select() + ->toArray(); + + $count = $model + ->where([ + ['uid', '=', $user_id], + ['del', '=', 0] + ]) + ->count(); + + return [ + 'count' => $count, + 'lists' => $lists, + 'page_no' => $get['page_no'], + 'page_size' => $get['page_size'], + 'more' => is_more($count, $get['page_no'], $get['page_size']) + ]; + + } catch (\Exception $e) { + return ['error'=>$e->getMessage()]; + } + } + + /** + * @notes 审核文章 + * @param $post + * @return bool + * @author 段誉 + * @date 2022/5/12 16:57 + */ + public static function audit($post) + { + try { + $article = OrganTeam::findOrEmpty($post['id']); + $article->audit_status = $post['audit_status']; + $article->audit_remark = $post['audit_remark'] ?? ''; + $article->audit_time = time(); + $article->save(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::$error = $e->getMessage(); + return false; + } + } + + } \ No newline at end of file diff --git a/app/admin/view/community/organ/audit.html b/app/admin/view/community/organ/audit.html new file mode 100644 index 0000000..bb4e86b --- /dev/null +++ b/app/admin/view/community/organ/audit.html @@ -0,0 +1,214 @@ +{layout name="layout2" /} + + +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+
+ +
+
+ +
+
+
+ + +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/app/admin/view/community/organ/lists.html b/app/admin/view/community/organ/lists.html index 8bc9b3c..1b79cfe 100644 --- a/app/admin/view/community/organ/lists.html +++ b/app/admin/view/community/organ/lists.html @@ -24,6 +24,17 @@ +
+ +
+ +
+
搜索 @@ -59,11 +70,26 @@ 付费{{d.price}}元下载 {{# } }} +
@@ -79,6 +105,7 @@ like.tableLists("#like-table-lists", "{:url()}?type=0", [ {field:"id", width:60, title:"ID"} ,{field:"name", width:200, align:"center", title:"名称"} + ,{field:"username", width:200, align:"center", title:"提交人"} ,{field:"image", width:100, align:"center", title:"封面图", templet:"#table-image"} ,{field:"company", width:180, align:"center", title:"企业名称"} ,{field:"address", width:180, align:"center", title:"区域"} @@ -86,12 +113,46 @@ ,{field:"intro", width:100, align:"center", title:"简介"} ,{field:"visit", width:100, align:"center", title:"浏览量"} ,{field:"sort", width:100, align:"center", title:"排序"} + ,{field:"audit_status", width:100, align:"center", title:"审核状态", templet:"#table-audit"} ,{field:"create_time", width:180, align:"center", title:"创建时间"} + ,{title:"操作", width:200, align:"center", fixed:"right", toolbar:"#table-operation"} ]); var active = { + audit: function(obj) { + layer.open({ + type: 2 + ,title: "机构审核" + ,content: "{:url('community.Organ/audit')}?id=" + obj.data.id + ,area: ["90%", "90%"] + ,btn: ["确定", "取消"] + ,yes: function(index, layero){ + var iframeWindow = window["layui-layer-iframe" + index]; + var submit = layero.find("iframe").contents().find("#addSubmit"); + iframeWindow.layui.form.on("submit(addSubmit)", function(data){ + data.field['id'] = obj.data.id; + like.ajax({ + url: "{:url('community.Organ/audit')}", + data: data.field, + type: "POST", + success:function(res) { + if(res.code === 1) { + layui.layer.msg(res.msg, {offset: '15px', icon: 1, time: 1000}); + layer.close(index); + table.reload("like-table-lists", { + where: {}, + page: { cur: 1 } + }); + } + } + }); + }); + submit.trigger("click"); + } + }); + }, add: function() { layer.open({ type: 2 diff --git a/app/admin/view/complain/complain/lists.html b/app/admin/view/complain/complain/lists.html index 5f00934..3280703 100644 --- a/app/admin/view/complain/complain/lists.html +++ b/app/admin/view/complain/complain/lists.html @@ -54,6 +54,11 @@ 图 {{# } }} + \ No newline at end of file diff --git a/app/api/controller/Help.php b/app/api/controller/Help.php index 7fc4d02..f5bfd21 100644 --- a/app/api/controller/Help.php +++ b/app/api/controller/Help.php @@ -39,4 +39,16 @@ class Help extends Api $data = HelpLogic::detail($id); return JsonServer::success('获取成功', $data); } + + + /** + * 详情 + */ + public function detail2() + { + $id = $this->request->get('id', ''); + $data = HelpLogic::detail2($id); + return JsonServer::success('获取成功', ['content' => $data]); + } + } \ No newline at end of file diff --git a/app/api/controller/User.php b/app/api/controller/User.php index a151222..5e05068 100644 --- a/app/api/controller/User.php +++ b/app/api/controller/User.php @@ -1,6 +1,7 @@ request->post(); + $post['uid'] = $this->user_id; + if(isset($post['id']) && $post['id']>0){ + $post['audit_status'] = 0; + $post['audit_remark'] = ''; + $res = OrganTeamLogic::edit($post, $this->user_id ); + }else{ + $post['audit_status'] = 0; + $post['audit_remark'] = ''; + $res = OrganTeamLogic::add($post, $this->user_id ); + } + + if ($res === false) { + $error = OrganTeamLogic::getError() ?: '提交失败'; + return JsonServer::error($error); + } + return JsonServer::success('提交成功'); + } + + /** + * @Notes: 机构申请记录列表 + * @Author: 张无忌 + */ + public function organRecord() + { + $get = $this->request->get(); + $get['page_no'] = $this->page_no; + $get['page_size'] = $this->page_size; + $lists = OrganTeamLogic::getUserOrgan($get, $this->user_id); + return JsonServer::success('获取成功', $lists); + } + + /** + * @Notes: 申请详细 + * @Author: 张无忌 + */ + public function organDetail() + { + $id = $this->request->get('id'); + $detail = OrganTeamLogic::detail($id); + return JsonServer::success('获取成功', $detail); + } + + } \ No newline at end of file diff --git a/app/api/logic/ArticleLogic.php b/app/api/logic/ArticleLogic.php index c633b4e..fe4a2af 100644 --- a/app/api/logic/ArticleLogic.php +++ b/app/api/logic/ArticleLogic.php @@ -21,12 +21,18 @@ class ArticleLogic extends Logic public static function category($get) { try { + $where = []; + if(isset($get['type']) && $get['type'] == 2){ + $where[] = ['id','in',[7,8]]; + }else{ + $where[] = ['id','not in',[7,8]]; + } $model = new ArticleCategory(); return $model->field(['id', 'name']) ->where([ ['del', '=', 0], ['is_show', '=', 1] - ])->select()->toArray(); + ])->where($where)->select()->toArray(); } catch (\Exception $e) { return ['error'=>$e->getMessage()]; @@ -48,6 +54,12 @@ class ArticleLogic extends Logic ['c.del', '=', 0], ['c.is_show', '=', 1], ]; + if(isset($get['type']) && $get['type'] == 2){ + $where[] = ['c.id','in',[7,8]]; + }else{ + $where[] = ['c.id','not in',[7,8]]; + } + if(isset($get['cid']) && !empty($get['cid'])) { $where[] = ['cid', '=', $get['cid']]; } diff --git a/app/api/logic/HelpLogic.php b/app/api/logic/HelpLogic.php index 336278b..a095470 100644 --- a/app/api/logic/HelpLogic.php +++ b/app/api/logic/HelpLogic.php @@ -7,6 +7,7 @@ namespace app\api\logic; use app\common\basics\Logic; use app\common\model\content\Help; use app\common\model\content\HelpCategory; +use app\common\server\ConfigServer; use app\common\server\JsonServer; use app\common\server\UrlServer; use think\facade\Db; @@ -92,4 +93,14 @@ class HelpLogic extends Logic $help['recommend_list'] = $recommend_list; return $help; } + + public static function detail2($id) + { + $service = ConfigServer::get('help', $id, ''); + $preg = '//i'; + $local_url = UrlServer::getFileUrl(); + $res = preg_replace($preg, '', $service); + return $res; + } + } \ No newline at end of file diff --git a/app/api/logic/ResourceLogic.php b/app/api/logic/ResourceLogic.php index a53aa4e..3cdf136 100644 --- a/app/api/logic/ResourceLogic.php +++ b/app/api/logic/ResourceLogic.php @@ -48,6 +48,7 @@ class ResourceLogic extends Logic { try { if(!isset($get['cid']) || !strstr($get['cid'],"my")){ + $where = [ ['a.del', '=', 0], ['a.is_show', '=', 1], @@ -55,6 +56,10 @@ class ResourceLogic extends Logic ['c.is_show', '=', 1], ]; + if(isset($get['keyword']) && $get['keyword']!=""){ + $where[] = ['a.title', 'like', "%".$get['keyword']."%"]; + } + if(isset($get['cid']) && !empty($get['cid']) && $get['cid']>0 && !strstr($get['cid'],"city_") ) { $where[] = ['cid', '=', $get['cid']]; } diff --git a/app/common/enum/MenuEnum.php b/app/common/enum/MenuEnum.php index 8c72ff3..d06d24c 100644 --- a/app/common/enum/MenuEnum.php +++ b/app/common/enum/MenuEnum.php @@ -71,8 +71,8 @@ class MenuEnum{ //商城资讯 [ 'index' => 107, - 'name' => '商城资讯', - 'link' => '/pages/news_list/news_list', + 'name' => '行业新闻', + 'link' => '/pages/news_list/news_list?cate=6', 'is_tab' => 0, 'link_type' => 1, ], @@ -188,13 +188,78 @@ class MenuEnum{ 'is_tab' => 0, 'link_type' => 1, ], + //商城资讯 + [ + 'index' => 123, + 'name' => '全国案例', + 'link' => '/pages/news_list/news_list?type=2', + 'is_tab' => 0, + 'link_type' => 1, + ], + //资料库 + [ + 'index' => 124, + 'name' => '吊篮基础资料', + 'link' => '/pages/resource_list/resource_list?index=1&cate=12', + 'is_tab' => 1, + 'link_type' => 1 + ], + //各地专家库 + [ + 'index' => 125, + 'name' => '各地专家库', + 'link' => '/pages/resource_list/resource_list?index=4', + 'is_tab' => 1, + 'link_type' => 1 + ], + //各地专家库 + [ + 'index' => 126, + 'name' => '证件办理', + 'link' => '/bundle/pages/help/detail?id=documents', + 'is_tab' => 0, + 'link_type' => 1, + ], + //各地专家库 + [ + 'index' => 127, + 'name' => '在线培训', + 'link' => '/bundle/pages/help/detail?id=train', + 'is_tab' => 0, + 'link_type' => 1, + ], + //各地专家库 + [ + 'index' => 128, + 'name' => '咨询我们', + 'link' => '/bundle/pages/help/detail?id=consult', + 'is_tab' => 0, + 'link_type' => 1, + ], + //种草社区 + [ + 'index' => 129, + 'name' => '吊篮租赁', + 'link' => '/pages/community/community?index=1&cate=12', + 'is_tab' => 1, + 'link_type' => 1, + ], + //投诉中心 + [ + 'index' => 130, + 'name' => '机构申请', + 'link' => '/bundle/pages/user/organ', + 'is_tab' => 0, + 'link_type' => 1, + ], //资料库 [ 'index' => 122, 'name' => '资料库', - 'link' => '/pages/resource_list/resource_list', - 'is_tab' => 0, + 'link' => '/pages/resource_list/resource_list?index=1&cate=12', + 'is_tab' => 1, 'link_type' => 1, + ] ]; @@ -305,6 +370,15 @@ class MenuEnum{ 'link_type' => 1, 'menu_type' => 1, ], + //投诉中心 + [ + 'index' => 1003, + 'name' => '机构申请', + 'link' => '/bundle/pages/user/organ', + 'is_tab' => 0, + 'link_type' => 1, + 'menu_type' => 1, + ], [ 'index' => 1002, 'name' => '资料库', diff --git a/app/common/server/UrlServer.php b/app/common/server/UrlServer.php index 6240d50..9793ee3 100644 --- a/app/common/server/UrlServer.php +++ b/app/common/server/UrlServer.php @@ -69,6 +69,7 @@ class UrlServer return str_replace($domain.'/', '', $uri); } else { $config = ConfigServer::get('storage_engine', $engine); + $config['domain'] = isset($config['domain'])?$config['domain']:"https://cdn.ahbcqz.com"; return str_replace($config['domain'], '', $uri); } } diff --git a/runtime/cache/9f/d2f37875d1da637002182ec566f162.php b/runtime/cache/9f/d2f37875d1da637002182ec566f162.php index 34f809f..99c2af3 100644 --- a/runtime/cache/9f/d2f37875d1da637002182ec566f162.php +++ b/runtime/cache/9f/d2f37875d1da637002182ec566f162.php @@ -1,4 +1,4 @@ -a:3:{i:0;s:75:"E:\waibao\ahbcqz\server\runtime\cache\ad\710db81cabed7a4fc183cdbe36b098.php";i:1;s:75:"E:\waibao\ahbcqz\server\runtime\cache\b0\2f627ee37a64f2b7a2192d33ffb6ce.php";i:2;s:75:"E:\waibao\ahbcqz\server\runtime\cache\a5\132d23a4f708efcceee81162e0d944.php";} \ No newline at end of file +a:4:{i:0;s:75:"E:\waibao\ahbcqz\server\runtime\cache\ad\710db81cabed7a4fc183cdbe36b098.php";i:1;s:75:"E:\waibao\ahbcqz\server\runtime\cache\b0\2f627ee37a64f2b7a2192d33ffb6ce.php";i:2;s:75:"E:\waibao\ahbcqz\server\runtime\cache\a5\132d23a4f708efcceee81162e0d944.php";i:3;s:75:"E:\waibao\ahbcqz\server\runtime\cache\51\5060a84cc9236c33edb430c07bcd5d.php";} \ No newline at end of file