Browse Source

支付

master
jianglong 3 years ago
parent
commit
f4d37e4ad2
  1. 26
      app/admin/controller/community/Organ.php
  2. 27
      app/admin/controller/setting/Basic.php
  3. 107
      app/admin/logic/community/OrganTeamLogic.php
  4. 214
      app/admin/view/community/organ/audit.html
  5. 67
      app/admin/view/community/organ/lists.html
  6. 7
      app/admin/view/complain/complain/lists.html
  7. 110
      app/admin/view/setting/basic/help.html
  8. 12
      app/api/controller/Help.php
  9. 53
      app/api/controller/User.php
  10. 14
      app/api/logic/ArticleLogic.php
  11. 11
      app/api/logic/HelpLogic.php
  12. 5
      app/api/logic/ResourceLogic.php
  13. 82
      app/common/enum/MenuEnum.php
  14. 1
      app/common/server/UrlServer.php
  15. 2
      runtime/cache/9f/d2f37875d1da637002182ec566f162.php

26
app/admin/controller/community/Organ.php

@ -4,11 +4,13 @@
namespace app\admin\controller\community; namespace app\admin\controller\community;
use app\admin\logic\community\CommunityArticleLogic;
use app\admin\logic\community\OrganTeamLogic; use app\admin\logic\community\OrganTeamLogic;
use app\admin\logic\content\HelpCategoryLogic; use app\admin\logic\content\HelpCategoryLogic;
use app\admin\logic\content\HelpLogic; use app\admin\logic\content\HelpLogic;
use app\admin\logic\content\ResourceCategoryLogic; use app\admin\logic\content\ResourceCategoryLogic;
use app\admin\logic\content\ResourceLogic; use app\admin\logic\content\ResourceLogic;
use app\admin\validate\community\CommunityArticleValidate;
use app\admin\validate\content\HelpValidate; use app\admin\validate\content\HelpValidate;
use app\common\basics\AdminBase; use app\common\basics\AdminBase;
use app\common\server\JsonServer; use app\common\server\JsonServer;
@ -116,4 +118,28 @@ class Organ extends AdminBase
return JsonServer::success('异常'); 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)
]);
}
} }

27
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('修改成功');
}
}
} }

107
app/admin/logic/community/OrganTeamLogic.php

@ -5,12 +5,17 @@ namespace app\admin\logic\community;
use app\common\basics\Logic; 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\community\OrganTeam;
use app\common\model\complain\Complain;
use app\common\model\content\Help; use app\common\model\content\Help;
use app\common\model\content\Resource; use app\common\model\content\Resource;
use app\common\model\user\User;
use app\common\server\AreaServer; use app\common\server\AreaServer;
use app\common\server\UrlServer; use app\common\server\UrlServer;
use Exception; use Exception;
use think\facade\Db;
class OrganTeamLogic extends Logic class OrganTeamLogic extends Logic
{ {
@ -27,13 +32,24 @@ class OrganTeamLogic extends Logic
]; ];
$where[] = ['type', '=', $type]; $where[] = ['type', '=', $type];
if (!empty($get['name']) and $get['name']) if (!empty($get['name']) && $get['name'])
$where[] = ['name', 'like', '%'.$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(); $model = new OrganTeam();
$lists = $model->field(true) $lists = $model->field(true)
->where($where) ->where($where)
->order('sort', 'asc') ->order('sort', 'asc')
->order('id', 'desc')
->paginate([ ->paginate([
'page' => $get['page'], 'page' => $get['page'],
'list_rows' => $get['limit'], 'list_rows' => $get['limit'],
@ -47,6 +63,17 @@ class OrganTeamLogic extends Logic
$item['province_id'], $item['province_id'],
$item['city_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']]; return ['count'=>$lists['total'], 'lists'=>$lists['data']];
@ -69,6 +96,10 @@ class OrganTeamLogic extends Logic
$model = new OrganTeam(); $model = new OrganTeam();
$detail = $model->field(true)->findOrEmpty($id)->toArray(); $detail = $model->field(true)->findOrEmpty($id)->toArray();
// $detail['path'] = UrlServer::getFileUrl($detail['path']); // $detail['path'] = UrlServer::getFileUrl($detail['path']);
$detail['address'] = $detail['province_id']?AreaServer::getAddress([
$detail['province_id'],
$detail['city_id'],
]):'';
return $detail; return $detail;
} }
@ -78,11 +109,11 @@ class OrganTeamLogic extends Logic
* @param $post * @param $post
* @return bool * @return bool
*/ */
public static function add($post) public static function add($post,$uid=0)
{ {
try { try {
OrganTeam::create([ OrganTeam::create([
'uid' => $uid,
'name' => $post['name'], 'name' => $post['name'],
'image' => $post['image'] ?? '', 'image' => $post['image'] ?? '',
'intro' => $post['intro'] ?? '', 'intro' => $post['intro'] ?? '',
@ -94,8 +125,9 @@ class OrganTeamLogic extends Logic
'visit' => 0, 'visit' => 0,
'contact' => $post['contact'] ?? '', 'contact' => $post['contact'] ?? '',
'sort' => $post['sort'] ?? 0, 'sort' => $post['sort'] ?? 0,
'is_show' => $post['is_show'], 'is_show' => $post['is_show']??0,
'company' => $post['company'] ?? '', 'company' => $post['company'] ?? '',
'audit_status' =>$post['audit_status'] ?? 1,
]); ]);
return true; return true;
@ -111,10 +143,11 @@ class OrganTeamLogic extends Logic
* @param $post * @param $post
* @return bool * @return bool
*/ */
public static function edit($post) public static function edit($post,$uid=0)
{ {
try { try {
OrganTeam::update([ OrganTeam::update([
'uid' => $uid,
'name' => $post['name'], 'name' => $post['name'],
'image' => $post['image'] ?? '', 'image' => $post['image'] ?? '',
'intro' => $post['intro'] ?? '', 'intro' => $post['intro'] ?? '',
@ -127,7 +160,8 @@ class OrganTeamLogic extends Logic
'visit' => 0, 'visit' => 0,
'contact' => $post['contact'] ?? '', 'contact' => $post['contact'] ?? '',
'sort' => $post['sort'] ?? 0, 'sort' => $post['sort'] ?? 0,
'is_show' => $post['is_show'] 'is_show' => $post['is_show']??0,
'audit_status' =>$post['audit_status'] ?? 1,
], ['id'=>$post['id']]); ], ['id'=>$post['id']]);
return true; return true;
@ -181,4 +215,65 @@ class OrganTeamLogic extends Logic
return false; 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;
}
}
} }

214
app/admin/view/community/organ/audit.html

@ -0,0 +1,214 @@
{layout name="layout2" /}
<style>
.layui-form-item .layui-input-inline { width: 340px; }
.pay-li {
float: left;
opacity: 1;
position: relative;
}
.pay-img {
width: 80px;
height: 80px;
padding: 4px;
}
.pay-img-del-x {
position: absolute;
z-index: 100;
top: -4px;
right: -2px;
width: 20px;
height: 20px;
font-size: 16px;
line-height: 16px;
color: #fff;
text-align: center;
cursor: pointer;
background: hsla(0, 0%, 60%, .6);
border-radius: 10px;
}
.upload-cert-a{
cursor: pointer;
position: absolute;
z-index: 100;
top: 58px;
right: -10%;
width: 100px;
height: 20px;
font-size: 8px;
line-height: 16px;
text-align: center;
border-radius: 10px;
color: #4e8bff;
}
.upload-cert-a:hover {
color: #0641cb;
}
.pay-cert{
height:80px;line-height:80px
}
.cert-add,.key-add{
height: 80px;
width: 80px;
float: left;
opacity: 1;
position: relative;
border:1px dashed #a0a0a0;
background-image:url('/static/common/image/default/add_file.png');
background-repeat: no-repeat;
background-position: 50% 35%;
background-size:40px 40px;
margin: 4px;
text-align: center;
}
</style>
<div class="layui-card layui-form" style="box-shadow:none;">
<div class="layui-card-body">
<div class="layui-form-item">
<label for="name" class="layui-form-label"><span style="color:red;">*</span>名称:</label>
<div class="layui-input-inline">
<input disabled type="text" name="name" id="name" value="{$detail.name}" lay-verType="tips" lay-verify="required" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="intro" class="layui-form-label">简介:</label>
<div class="layui-input-inline">
<input disabled type="text" name="intro" id="intro" value="{$detail.intro ?? ''}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="company" class="layui-form-label">企业名称:</label>
<div class="layui-input-inline">
<input disabled type="text" name="company" id="company" value="{$detail.company ?? ''}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label for="contact" class="layui-form-label">联系方式:</label>
<div class="layui-input-inline">
<input disabled type="text" name="contact" id="contact" value="{$detail.contact ?? ''}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">封面图:</label>
<div class="layui-input-block">
<div class="like-upload-image">
{if $detail.image}
<div class="upload-image-div">
<img src="{$detail.image}" alt="img">
<input type="hidden" name="image" value="{$detail.image}">
</div>
{/if}
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">区域:</label>
<div class="layui-input-block">
<div class="layui-input-inline" style="width:120px;">
<select name="province_id" id="province" lay-filter="province"></select>
</div>
<div class="layui-input-inline" style="width:120px;">
<select name="city_id" id="city" lay-filter="city"></select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span style="color:red;">*</span>审核状态:</label>
<div class="layui-input-block">
<input type="radio" name="audit_status" value="1" title="通过" {if $detail.audit_status}checked{/if}>
<input type="radio" name="audit_status" value="2" title="拒绝" {if !$detail.audit_status}checked{/if}>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span style="color:red;">*</span>审核说明:</label>
<div class="layui-input-block" style="width: 50%">
<textarea class="layui-textarea" name="audit_remark"></textarea>
</div>
</div>
<div class="layui-form-item layui-hide">
<input type="button" lay-submit lay-filter="addSubmit" id="addSubmit" value="确认">
</div>
</div>
</div>
<script src="__PUBLIC__/static/common/js/area.js"></script>
<script>
layui.config({
base: "/static/lib/"
}).extend({
likeedit: "likeedit/likeedit",
likeArea: "likeArea/likeArea",
}).use(["likeedit", "likeArea", "form"], function(){
var form = layui.form;
var likeedit = layui.likeedit;
var likeArea = layui.likeArea;
var content = likeedit.build("content", {
uploadImage: {
url: '{:url("file/lists")}?type=10'
}
});
form.verify({
content: function() {
likeedit.sync(content)
}
});
like.delUpload();
$(document).on("click", ".add-upload-image", function () {
like.imageUpload({
limit: 1,
field: "image",
that: $(this)
});
});
//删除图片/证书
$(document).on('click', '.pay-img-del-x', function () {
$(this).parent().siblings('input').val('');
$(this).parent().siblings().css('display','block');
$(this).parent().remove();
});
//==========================================上传证书start=========================================================
like.certUpload('.cert-add', '{:url("file/other")}?local=1&sub_dir=resource', '{$storageUrl}');
//==========================================上传证书end===========================================================
// 删除按钮的显示与隐藏
$(document).on('mouseover', '.pay-img', function () {
$(this).next().show();
});
$(document).on('mouseout', '.pay-img', function () {
$(this).next().hide();
});
$(document).on('mouseover', '.pay-img-del-x', function () {
$(this).show();
});
$(document).on('mouseout', '.pay-img-del-x', function () {
$(this).hide();
});
likeArea.init(
"province", "city", "district", "province_id", "city_id", "district_id",
"{$detail.province_id}", "{$detail.city_id}", "{$detail.district_id}"
);
likeArea.init(
"refund_province", "refund_city", "refund_district", "refund_province_id", "refund_city_id", "refund_district_id",
"{$detail.refund_address.province_id ?? ''}", "{$detail.refund_address.city_id ?? ''}", "{$detail.refund_address.district_id ?? ''}"
);
})
</script>

67
app/admin/view/community/organ/lists.html

@ -24,6 +24,17 @@
<input type="text" id="name" name="name" autocomplete="off" class="layui-input"> <input type="text" id="name" name="name" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-inline">
<label for="audit_status" class="layui-form-label">审核状态:</label>
<div class="layui-input-inline">
<select name="audit_status" id="audit_status">
<option value="">全部</option>
<option value="0">未处理</option>
<option value="1">通过</option>
<option value="2">拒绝</option>
</select>
</div>
</div>
<input type="hidden" id="type" name="type" value="0"> <input type="hidden" id="type" name="type" value="0">
<div class="layui-inline"> <div class="layui-inline">
<a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a> <a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
@ -59,11 +70,26 @@
付费{{d.price}}元下载 付费{{d.price}}元下载
{{# } }} {{# } }}
</script> </script>
<script type="text/html" id="table-audit">
{{# if(d.audit_status == 0){ }}
未审核
{{# } }}
{{# if(d.audit_status == 1){ }}
通过
{{# } }}
{{# if(d.audit_status == 2){ }}
拒绝
{{# } }}
</script>
<script type="text/html" id="table-operation"> <script type="text/html" id="table-operation">
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a> {{# if(d.audit_status == 1 ){ }} <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a> {{# } }}
{{# if(d.is_show == '显示'){ }}<a class="layui-btn layui-btn-normal layui-btn-sm layui-btn-warm" lay-event="hide">隐藏</a>{{# } }} {{# if(d.audit_status == 1 && d.is_show == '显示'){ }}<a class="layui-btn layui-btn-normal layui-btn-sm layui-btn-warm" lay-event="hide">隐藏</a>{{# } }}
{{# if(d.is_show == '隐藏'){ }}<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="hide">显示</a>{{# } }} {{# if(d.audit_status == 1 && d.is_show == '隐藏'){ }}<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="hide">显示</a>{{# } }}
{{# if(d.audit_status == 0){ }}
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="audit">审核</a>
{{# } }}
<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a> <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
</script> </script>
</div> </div>
@ -79,6 +105,7 @@
like.tableLists("#like-table-lists", "{:url()}?type=0", [ like.tableLists("#like-table-lists", "{:url()}?type=0", [
{field:"id", width:60, title:"ID"} {field:"id", width:60, title:"ID"}
,{field:"name", width:200, align:"center", title:"名称"} ,{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:"image", width:100, align:"center", title:"封面图", templet:"#table-image"}
,{field:"company", width:180, align:"center", title:"企业名称"} ,{field:"company", width:180, align:"center", title:"企业名称"}
,{field:"address", width:180, align:"center", title:"区域"} ,{field:"address", width:180, align:"center", title:"区域"}
@ -86,12 +113,46 @@
,{field:"intro", width:100, align:"center", title:"简介"} ,{field:"intro", width:100, align:"center", title:"简介"}
,{field:"visit", width:100, align:"center", title:"浏览量"} ,{field:"visit", width:100, align:"center", title:"浏览量"}
,{field:"sort", 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:"创建时间"} ,{field:"create_time", width:180, align:"center", title:"创建时间"}
,{title:"操作", width:200, align:"center", fixed:"right", toolbar:"#table-operation"} ,{title:"操作", width:200, align:"center", fixed:"right", toolbar:"#table-operation"}
]); ]);
var active = { 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() { add: function() {
layer.open({ layer.open({
type: 2 type: 2

7
app/admin/view/complain/complain/lists.html

@ -54,6 +54,11 @@
<img src="{{d.image}}" alt="图" style="width:28px;height:28px;"> <img src="{{d.image}}" alt="图" style="width:28px;height:28px;">
{{# } }} {{# } }}
</script> </script>
<script type="text/html" id="table-category">
{{# if(d.category){ }}
{{d.category.name}}
{{# } }}
</script>
<script type="text/html" id="table-avatar"> <script type="text/html" id="table-avatar">
{{# if(d.avatar){ }} {{# if(d.avatar){ }}
<img src="{{d.avatar}}" alt="图" style="width:28px;height:28px;"> <img src="{{d.avatar}}" alt="图" style="width:28px;height:28px;">
@ -77,7 +82,7 @@
{field:"id", width:60, title:"ID"} {field:"id", width:60, title:"ID"}
,{field:"username", width:200, align:"center", title:"用户名称"} ,{field:"username", width:200, align:"center", title:"用户名称"}
,{field:"avatar", width:100, align:"center", title:"用户头像", templet:"#table-avatar"} ,{field:"avatar", width:100, align:"center", title:"用户头像", templet:"#table-avatar"}
,{field:"category", width:150, align:"center", title:"投诉分类"} ,{field:"category", width:150, align:"center", title:"投诉分类",templet:"#table-category"}
,{field:"is_complate", width:100, align:"center", title:"处理状态"} ,{field:"is_complate", width:100, align:"center", title:"处理状态"}
,{field:"image", width:100, align:"center", title:"截图", templet:"#table-image"} ,{field:"image", width:100, align:"center", title:"截图", templet:"#table-image"}
,{field:"content", align:"center", title:"投诉内容"} ,{field:"content", align:"center", title:"投诉内容"}

110
app/admin/view/setting/basic/help.html

@ -0,0 +1,110 @@
{layout name="layout1" /}
<div class="wrapper">
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
<div class="layui-colla-item">
<h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
<div class="layui-colla-content layui-show">
<p>*证件办理,首页导航显示。</p>
<p>*在线培训,首页导航显示。</p>
<p>*咨询我们,首页导航显示。</p>
</div>
</div>
</div>
</div>
<div class="layui-form" lay-filter="">
<div class="layui-tab layui-tab-card">
<ul class="layui-tab-title">
<li class="layui-this">证件办理</li>
<li>在线培训</li>
<li>咨询我们</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<label class="layui-form-label" style="white-space: nowrap;">内容:</label>
<div class="layui-input-block">
<textarea name="documents" id="documents" lay-verify="content" class="field-content">{$config.documents}</textarea>
</div>
</div>
<div class="layui-tab-item">
<label class="layui-form-label" style="white-space: nowrap;">内容:</label>
<div class="layui-input-block">
<textarea name="train" id="train" lay-verify="content" class="field-content">{$config.train}</textarea>
</div>
</div>
<div class="layui-tab-item">
<label class="layui-form-label" style="white-space: nowrap;">内容:</label>
<div class="layui-input-block">
<textarea name="consult" id="consult" lay-verify="content" class="field-content">{$config.consult}</textarea>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn {$view_theme_color}" lay-submit lay-filter="addSubmit">确认</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
layui.config({
base: "/static/lib/"
}).extend({
likeedit: "likeedit/likeedit"
}).use(["form", "likeedit"], function () {
var $ = layui.$
, form = layui.form
, likeedit = layui.likeedit;
//富文本上传图片
likeedit.set({
uploadImage: {
url: "{:url('file/lists')}",
type: 'post'
}
})
var likeedit_documents = likeedit.build('documents');
var likeedit_train = likeedit.build('train');
var likeedit_consult= likeedit.build('consult');
form.verify({
content: function () {
likeedit.sync(likeedit_documents);
likeedit.sync(likeedit_train);
likeedit.sync(likeedit_consult);
}
});
form.on("submit(addSubmit)", function(data){
data.field['documents'] = likeedit.getContent(likeedit_documents);
data.field['train'] = likeedit.getContent(likeedit_train);
data.field['consult'] = likeedit.getContent(likeedit_consult);
like.ajax({
url: "{:url('setting.basic/setHelp')}",
data: data.field,
type: "POST",
success:function(res) {
if(res.code === 1) {
layer.msg(res.msg, {
offset: '15px'
, icon: 1
, time: 1500
},function () {
location.href = location.href;
});
}
}
});
});
});
</script>

12
app/api/controller/Help.php

@ -39,4 +39,16 @@ class Help extends Api
$data = HelpLogic::detail($id); $data = HelpLogic::detail($id);
return JsonServer::success('获取成功', $data); return JsonServer::success('获取成功', $data);
} }
/**
* 详情
*/
public function detail2()
{
$id = $this->request->get('id', '');
$data = HelpLogic::detail2($id);
return JsonServer::success('获取成功', ['content' => $data]);
}
} }

53
app/api/controller/User.php

@ -1,6 +1,7 @@
<?php <?php
namespace app\api\controller; namespace app\api\controller;
use app\admin\logic\community\OrganTeamLogic;
use app\admin\logic\complain\ComplainCategoryLogic; use app\admin\logic\complain\ComplainCategoryLogic;
use app\admin\logic\complain\ComplainLogic; use app\admin\logic\complain\ComplainLogic;
use app\api\logic\ShopApplyLogic; use app\api\logic\ShopApplyLogic;
@ -274,4 +275,56 @@ class User extends Api
return JsonServer::success('获取成功', $detail); return JsonServer::success('获取成功', $detail);
} }
/**
* @Notes: 提交机构申请
* @Author: 张无忌
*/
public function organ()
{
$post = $this->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);
}
} }

14
app/api/logic/ArticleLogic.php

@ -21,12 +21,18 @@ class ArticleLogic extends Logic
public static function category($get) public static function category($get)
{ {
try { try {
$where = [];
if(isset($get['type']) && $get['type'] == 2){
$where[] = ['id','in',[7,8]];
}else{
$where[] = ['id','not in',[7,8]];
}
$model = new ArticleCategory(); $model = new ArticleCategory();
return $model->field(['id', 'name']) return $model->field(['id', 'name'])
->where([ ->where([
['del', '=', 0], ['del', '=', 0],
['is_show', '=', 1] ['is_show', '=', 1]
])->select()->toArray(); ])->where($where)->select()->toArray();
} catch (\Exception $e) { } catch (\Exception $e) {
return ['error'=>$e->getMessage()]; return ['error'=>$e->getMessage()];
@ -48,6 +54,12 @@ class ArticleLogic extends Logic
['c.del', '=', 0], ['c.del', '=', 0],
['c.is_show', '=', 1], ['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'])) { if(isset($get['cid']) && !empty($get['cid'])) {
$where[] = ['cid', '=', $get['cid']]; $where[] = ['cid', '=', $get['cid']];
} }

11
app/api/logic/HelpLogic.php

@ -7,6 +7,7 @@ namespace app\api\logic;
use app\common\basics\Logic; use app\common\basics\Logic;
use app\common\model\content\Help; use app\common\model\content\Help;
use app\common\model\content\HelpCategory; use app\common\model\content\HelpCategory;
use app\common\server\ConfigServer;
use app\common\server\JsonServer; use app\common\server\JsonServer;
use app\common\server\UrlServer; use app\common\server\UrlServer;
use think\facade\Db; use think\facade\Db;
@ -92,4 +93,14 @@ class HelpLogic extends Logic
$help['recommend_list'] = $recommend_list; $help['recommend_list'] = $recommend_list;
return $help; return $help;
} }
public static function detail2($id)
{
$service = ConfigServer::get('help', $id, '');
$preg = '/<img.*?src="((?!(https|http)).*?)".*?\/?>/i';
$local_url = UrlServer::getFileUrl();
$res = preg_replace($preg, '<img src="' . $local_url . '${1}" />', $service);
return $res;
}
} }

5
app/api/logic/ResourceLogic.php

@ -48,6 +48,7 @@ class ResourceLogic extends Logic
{ {
try { try {
if(!isset($get['cid']) || !strstr($get['cid'],"my")){ if(!isset($get['cid']) || !strstr($get['cid'],"my")){
$where = [ $where = [
['a.del', '=', 0], ['a.del', '=', 0],
['a.is_show', '=', 1], ['a.is_show', '=', 1],
@ -55,6 +56,10 @@ class ResourceLogic extends Logic
['c.is_show', '=', 1], ['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_") ) { if(isset($get['cid']) && !empty($get['cid']) && $get['cid']>0 && !strstr($get['cid'],"city_") ) {
$where[] = ['cid', '=', $get['cid']]; $where[] = ['cid', '=', $get['cid']];
} }

82
app/common/enum/MenuEnum.php

@ -71,8 +71,8 @@ class MenuEnum{
//商城资讯 //商城资讯
[ [
'index' => 107, 'index' => 107,
'name' => '商城资讯', 'name' => '行业新闻',
'link' => '/pages/news_list/news_list', 'link' => '/pages/news_list/news_list?cate=6',
'is_tab' => 0, 'is_tab' => 0,
'link_type' => 1, 'link_type' => 1,
], ],
@ -188,13 +188,78 @@ class MenuEnum{
'is_tab' => 0, 'is_tab' => 0,
'link_type' => 1, '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, 'index' => 122,
'name' => '资料库', 'name' => '资料库',
'link' => '/pages/resource_list/resource_list', 'link' => '/pages/resource_list/resource_list?index=1&cate=12',
'is_tab' => 0, 'is_tab' => 1,
'link_type' => 1, 'link_type' => 1,
] ]
]; ];
@ -305,6 +370,15 @@ class MenuEnum{
'link_type' => 1, 'link_type' => 1,
'menu_type' => 1, 'menu_type' => 1,
], ],
//投诉中心
[
'index' => 1003,
'name' => '机构申请',
'link' => '/bundle/pages/user/organ',
'is_tab' => 0,
'link_type' => 1,
'menu_type' => 1,
],
[ [
'index' => 1002, 'index' => 1002,
'name' => '资料库', 'name' => '资料库',

1
app/common/server/UrlServer.php

@ -69,6 +69,7 @@ class UrlServer
return str_replace($domain.'/', '', $uri); return str_replace($domain.'/', '', $uri);
} else { } else {
$config = ConfigServer::get('storage_engine', $engine); $config = ConfigServer::get('storage_engine', $engine);
$config['domain'] = isset($config['domain'])?$config['domain']:"https://cdn.ahbcqz.com";
return str_replace($config['domain'], '', $uri); return str_replace($config['domain'], '', $uri);
} }
} }

2
runtime/cache/9f/d2f37875d1da637002182ec566f162.php

@ -1,4 +1,4 @@
<?php <?php
//000000000000 //000000000000
exit();?> exit();?>
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";} 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";}
Loading…
Cancel
Save