wugg 1 year ago
commit
34425d087e
100 changed files with 5143 additions and 0 deletions
  1. 3 0
      .gitignore
  2. 32 0
      LICENSE.txt
  3. 56 0
      README.md
  4. 1 0
      app/.htaccess
  5. 22 0
      app/AppService.php
  6. 94 0
      app/BaseController.php
  7. 58 0
      app/ExceptionHandle.php
  8. 85 0
      app/Index/controller/index.php
  9. 8 0
      app/Request.php
  10. 205 0
      app/admin/controller/Action.php
  11. 192 0
      app/admin/controller/Cloud.php
  12. 170 0
      app/admin/controller/Deal.php
  13. 163 0
      app/admin/controller/Departuser.php
  14. 84 0
      app/admin/controller/Login.php
  15. 168 0
      app/admin/controller/Manange.php
  16. 261 0
      app/admin/controller/Menu.php
  17. 162 0
      app/admin/controller/Model.php
  18. 285 0
      app/admin/controller/Newfill.php
  19. 397 0
      app/admin/controller/Note.php
  20. 363 0
      app/admin/controller/Role.php
  21. 338 0
      app/admin/controller/User.php
  22. 85 0
      app/admin/controller/index.php
  23. 45 0
      app/admin/model/NoteLog.php
  24. 75 0
      app/admin/route/app.php
  25. 256 0
      app/common.php
  26. 17 0
      app/event.php
  27. 10 0
      app/middleware.php
  28. 9 0
      app/provider.php
  29. 9 0
      app/service.php
  30. 49 0
      composer.json
  31. 1011 0
      composer.lock
  32. 33 0
      config/app.php
  33. 29 0
      config/cache.php
  34. 9 0
      config/console.php
  35. 20 0
      config/cookie.php
  36. 63 0
      config/database.php
  37. 24 0
      config/filesystem.php
  38. 27 0
      config/lang.php
  39. 45 0
      config/log.php
  40. 8 0
      config/middleware.php
  41. 22 0
      config/note.php
  42. 45 0
      config/route.php
  43. 19 0
      config/session.php
  44. 10 0
      config/trace.php
  45. 25 0
      config/view.php
  46. 0 0
      public/.htaccess
  47. BIN
      public/favicon.ico
  48. 26 0
      public/index.php
  49. 4 0
      public/nginx.htaccess
  50. 2 0
      public/robots.txt
  51. 19 0
      public/router.php
  52. BIN
      public/storage/topic/20211216/e2d170c95faa7ce010d3d16607c54e3_20211216200628.png
  53. BIN
      public/storage/topic/20211216/e2d170c95faa7ce010d3d16607c54e3_20211216200707.png
  54. BIN
      public/storage/topic/20220418/1_20220418194211.png
  55. BIN
      public/storage/topic/20220418/image_20220418194247.png
  56. BIN
      public/storage/topic/20220419/image_20220419120118.png
  57. BIN
      public/storage/topic/20220420/image_20220420095703.png
  58. BIN
      public/storage/topic/20220420/image_20220420095937.png
  59. BIN
      public/storage/topic/20220420/image_20220420100104.png
  60. BIN
      public/storage/topic/20220426/image_20220426130519.png
  61. BIN
      public/storage/topic/20220426/image_20220426130616.png
  62. BIN
      public/storage/topic/20220426/image_20220426130649.png
  63. BIN
      public/storage/topic/20220426/image_20220426130900.png
  64. BIN
      public/storage/topic/20220426/image_20220426131130.png
  65. BIN
      public/storage/topic/20220426/image_20220426131309.png
  66. BIN
      public/storage/topic/20220427/image_20220427131844.png
  67. BIN
      public/storage/topic/20220427/image_20220427143531.png
  68. BIN
      public/storage/topic/20220427/image_20220427144252.png
  69. BIN
      public/storage/topic/20220427/image_20220427145740.png
  70. BIN
      public/storage/topic/20220427/image_20220427145934.png
  71. BIN
      public/storage/topic/20220427/image_20220427150138.png
  72. BIN
      public/storage/topic/20220427/image_20220427150513.png
  73. BIN
      public/storage/topic/20220427/image_20220427150526.png
  74. BIN
      public/storage/topic/20220427/image_20220427151143.png
  75. BIN
      public/storage/topic/20220427/image_20220427151316.png
  76. BIN
      public/storage/topic/20220427/image_20220427151331.png
  77. BIN
      public/storage/topic/20220427/image_20220427152131.png
  78. BIN
      public/storage/topic/20220427/image_20220427152508.png
  79. BIN
      public/storage/topic/20220427/image_20220427161244.png
  80. BIN
      public/storage/topic/20220427/image_20220427163502.png
  81. BIN
      public/storage/topic/20220428/image_20220428094534.png
  82. BIN
      public/storage/topic/20220428/image_20220428095524.png
  83. BIN
      public/storage/topic/20220428/image_20220428095804.png
  84. BIN
      public/storage/topic/20220428/image_20220428101533.png
  85. BIN
      public/storage/topic/20220428/image_20220428101743.png
  86. BIN
      public/storage/topic/20220428/image_20220428101821.png
  87. BIN
      public/storage/topic/20220428/image_20220428101903.png
  88. BIN
      public/storage/topic/20220428/image_20220428112407.png
  89. BIN
      public/storage/topic/20220428/image_20220428112844.png
  90. BIN
      public/storage/topic/20220428/image_20220428131914.png
  91. BIN
      public/storage/topic/20220428/image_20220428132404.png
  92. BIN
      public/storage/topic/20220428/image_20220428171352.png
  93. BIN
      public/storage/topic/20220428/image_20220428171428.png
  94. BIN
      public/storage/topic/20220428/image_20220428171758.png
  95. BIN
      public/storage/topic/20220428/image_20220428172851.png
  96. BIN
      public/storage/topic/20220428/image_20220428173015.png
  97. BIN
      public/storage/topic/20220428/image_20220428173153.png
  98. BIN
      public/storage/topic/20220505/image_20220505150258.png
  99. BIN
      public/storage/topic/20220505/image_20220505151221.png
  100. BIN
      public/storage/topic/20220507/image_20220507132402.png

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/vendor/
+.env
+/runtime/

+ 32 - 0
LICENSE.txt

@@ -0,0 +1,32 @@
+
+ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
+版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
+All rights reserved。
+ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
+
+Apache Licence是著名的非盈利开源组织Apache采用的协议。
+该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,
+允许代码修改,再作为开源或商业软件发布。需要满足
+的条件: 
+1. 需要给代码的用户一份Apache Licence ;
+2. 如果你修改了代码,需要在被修改的文件中说明;
+3. 在延伸的代码中(修改和有源代码衍生的代码中)需要
+带有原来代码中的协议,商标,专利声明和其他原来作者规
+定需要包含的说明;
+4. 如果再发布的产品中包含一个Notice文件,则在Notice文
+件中需要带有本协议内容。你可以在Notice中增加自己的
+许可,但不可以表现为对Apache Licence构成更改。 
+具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.

+ 56 - 0
README.md

@@ -0,0 +1,56 @@
+ThinkPHP 6.0
+===============
+
+> 运行环境要求PHP7.1+,兼容PHP8.0。
+
+[官方应用服务市场](https://market.topthink.com) | [`ThinkAPI`——官方统一API服务](https://docs.topthink.com/think-api)
+
+ThinkPHPV6.0版本由[亿速云](https://www.yisu.com/)独家赞助发布。
+
+## 主要新特性
+
+* 采用`PHP7`强类型(严格模式)
+* 支持更多的`PSR`规范
+* 原生多应用支持
+* 更强大和易用的查询
+* 全新的事件系统
+* 模型事件和数据库事件统一纳入事件系统
+* 模板引擎分离出核心
+* 内部功能中间件化
+* SESSION/Cookie机制改进
+* 对Swoole以及协程支持改进
+* 对IDE更加友好
+* 统一和精简大量用法
+
+## 安装
+
+~~~
+composer create-project topthink/think tp 6.0.*
+~~~
+
+如果需要更新框架使用
+~~~
+composer update topthink/framework
+~~~
+
+## 文档
+
+[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content)
+
+## 参与开发
+
+请参阅 [ThinkPHP 核心框架包](https://github.com/top-think/framework)。
+
+## 版权信息
+
+ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
+
+本项目包含的第三方源码和二进制文件之版权信息另行标注。
+
+版权所有Copyright © 2006-2020 by ThinkPHP (http://thinkphp.cn)
+
+All rights reserved。
+
+ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
+
+更多细节参阅 [LICENSE.txt](LICENSE.txt)

+ 1 - 0
app/.htaccess

@@ -0,0 +1 @@
+deny from all

+ 22 - 0
app/AppService.php

@@ -0,0 +1,22 @@
+<?php
+declare (strict_types = 1);
+
+namespace app;
+
+use think\Service;
+
+/**
+ * 应用服务类
+ */
+class AppService extends Service
+{
+    public function register()
+    {
+        // 服务注册
+    }
+
+    public function boot()
+    {
+        // 服务启动
+    }
+}

+ 94 - 0
app/BaseController.php

@@ -0,0 +1,94 @@
+<?php
+declare (strict_types = 1);
+
+namespace app;
+
+use think\App;
+use think\exception\ValidateException;
+use think\Validate;
+
+/**
+ * 控制器基础类
+ */
+abstract class BaseController
+{
+    /**
+     * Request实例
+     * @var \think\Request
+     */
+    protected $request;
+
+    /**
+     * 应用实例
+     * @var \think\App
+     */
+    protected $app;
+
+    /**
+     * 是否批量验证
+     * @var bool
+     */
+    protected $batchValidate = false;
+
+    /**
+     * 控制器中间件
+     * @var array
+     */
+    protected $middleware = [];
+
+    /**
+     * 构造方法
+     * @access public
+     * @param  App  $app  应用对象
+     */
+    public function __construct(App $app)
+    {
+        $this->app     = $app;
+        $this->request = $this->app->request;
+
+        // 控制器初始化
+        $this->initialize();
+    }
+
+    // 初始化
+    protected function initialize()
+    {}
+
+    /**
+     * 验证数据
+     * @access protected
+     * @param  array        $data     数据
+     * @param  string|array $validate 验证器名或者验证规则数组
+     * @param  array        $message  提示信息
+     * @param  bool         $batch    是否批量验证
+     * @return array|string|true
+     * @throws ValidateException
+     */
+    protected function validate(array $data, $validate, array $message = [], bool $batch = false)
+    {
+        if (is_array($validate)) {
+            $v = new Validate();
+            $v->rule($validate);
+        } else {
+            if (strpos($validate, '.')) {
+                // 支持场景
+                [$validate, $scene] = explode('.', $validate);
+            }
+            $class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
+            $v     = new $class();
+            if (!empty($scene)) {
+                $v->scene($scene);
+            }
+        }
+
+        $v->message($message);
+
+        // 是否批量验证
+        if ($batch || $this->batchValidate) {
+            $v->batch(true);
+        }
+
+        return $v->failException(true)->check($data);
+    }
+
+}

+ 58 - 0
app/ExceptionHandle.php

@@ -0,0 +1,58 @@
+<?php
+namespace app;
+
+use think\db\exception\DataNotFoundException;
+use think\db\exception\ModelNotFoundException;
+use think\exception\Handle;
+use think\exception\HttpException;
+use think\exception\HttpResponseException;
+use think\exception\ValidateException;
+use think\Response;
+use Throwable;
+
+/**
+ * 应用异常处理类
+ */
+class ExceptionHandle extends Handle
+{
+    /**
+     * 不需要记录信息(日志)的异常类列表
+     * @var array
+     */
+    protected $ignoreReport = [
+        HttpException::class,
+        HttpResponseException::class,
+        ModelNotFoundException::class,
+        DataNotFoundException::class,
+        ValidateException::class,
+    ];
+
+    /**
+     * 记录异常信息(包括日志或者其它方式记录)
+     *
+     * @access public
+     * @param  Throwable $exception
+     * @return void
+     */
+    public function report(Throwable $exception): void
+    {
+        // 使用内置的方式记录异常日志
+        parent::report($exception);
+    }
+
+    /**
+     * Render an exception into an HTTP response.
+     *
+     * @access public
+     * @param \think\Request   $request
+     * @param Throwable $e
+     * @return Response
+     */
+    public function render($request, Throwable $e): Response
+    {
+        // 添加自定义异常处理机制
+
+        // 其他错误交给系统处理
+        return parent::render($request, $e);
+    }
+}

+ 85 - 0
app/Index/controller/index.php

@@ -0,0 +1,85 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\Index\controller;
+
+use think\Request;
+
+class index
+{
+    /**
+     * 显示资源列表
+     *
+     * @return \think\Response
+     */
+    public function index()
+    {
+        //
+    }
+
+    /**
+     * 显示创建资源表单页.
+     *
+     * @return \think\Response
+     */
+    public function create()
+    {
+        //
+    }
+
+    /**
+     * 保存新建的资源
+     *
+     * @param  \think\Request  $request
+     * @return \think\Response
+     */
+    public function save(Request $request)
+    {
+        //
+    }
+
+    /**
+     * 显示指定的资源
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function read($id)
+    {
+        //
+    }
+
+    /**
+     * 显示编辑资源表单页.
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function edit($id)
+    {
+        //
+    }
+
+    /**
+     * 保存更新的资源
+     *
+     * @param  \think\Request  $request
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function update(Request $request, $id)
+    {
+        //
+    }
+
+    /**
+     * 删除指定资源
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function delete($id)
+    {
+        //
+    }
+}

+ 8 - 0
app/Request.php

@@ -0,0 +1,8 @@
+<?php
+namespace app;
+
+// 应用请求对象类
+class Request extends \think\Request
+{
+
+}

+ 205 - 0
app/admin/controller/Action.php

@@ -0,0 +1,205 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\controller;
+
+use app\BaseController;
+use think\facade\Db;
+use think\Request;
+use think\App;
+
+class Action extends BaseController
+{
+
+    public function __construct(App $app)
+    {
+        parent::__construct($app);
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+
+        }
+    }
+    /**
+     * 显示资源列表
+     *
+     * @return \think\Response
+     */
+    public function ActionList(){
+        $post  =$this->request->post();
+        $pageid = isset($post['id']) ? intval($post['id']) : "";
+        if($pageid==""){
+            return error_show(1001,'页面id不能为空');
+        }
+        $condition = ['menuid'=>$pageid];
+        $data=Db::name('action')->alias("a")->leftJoin("action_list l","a.action_code=l.action_code")->field
+        ("a.*,action_name")->where($condition)->select();
+        return app_show(0,"获取成功",$data);
+    }
+
+    public function ActionSave(){
+        $post  =$this->request->post();
+        $actionid = isset($post['id']) ? intval($post['id']) : "";
+        if($actionid!=""){
+            $isf= Db::name("action_list")->where("id","=",$actionid)->find();
+            if($isf==false){
+                return error_show(1005,"未找到数据");
+            }
+        }
+        $action = isset($post['action_name']) ? trim($post['action_name']) : "";
+        if($action==""){
+            return error_show(1003,'功能名称不能为空');
+        }
+        $desc = isset($post['action_desc']) ? trim($post['action_desc']) : "";
+        $status = isset($post['status']) ? intval($post['status']) : 0;
+        $action_code = isset($post['action_code']) ? intval($post['action_code']) : 0;
+        $data=[
+            "action_name"=>$action,
+            "action_desc"=>$desc,
+            "action_code"=>$action_code,
+        ];
+
+        $isTrue =  Db::name("action_list")->where(["action_name"=>$action])->find();
+        if($isTrue){
+            if($isTrue['id']!=$actionid || $actionid==""){
+                return error_show(1003,'功能名称不能重复');
+            }
+        }
+
+        try{
+            $message = "";
+            if($actionid==""){
+                $data['status']=$status;
+                $data['is_show']=1;
+                $message = "新建成功";
+            }else{
+                $data['status']=$status;
+                $data['id']=$actionid;
+                $message = "更新成功";
+            }
+            Db::name("action_list")->save($data);
+            return app_show(0,$message);
+        }catch (\Exception $e){
+            return  error_show(1005,$e->getMessage());
+        }
+    }
+
+    public function ActionStatus(){
+        $post  =$this->request->post();
+
+        $actid = isset($post['id']) ? intval($post['id']) : "";
+        if($actid==""){
+            return error_show(1001,'功能id不能为空');
+        }
+        $status = isset($post['status']) ? intval($post['status']) : 1;
+        try{
+            $data = ['status'=>$status,"updatetime"=>date("Y-m-d H:i:s")];
+            $result=Db::name("action")->where("id","=",$actid)->save($data);
+            if($result){
+                return app_show(0,"更新成功");
+            }else{
+                return error_show(1004,"更新失败");
+            }
+        }catch (\Exception $e){
+            return error_show(1003,$e->getMessage());
+        }
+    }
+
+    /**
+     * @return \think\response\Json|void
+     * @throws \think\exception\DbException
+     */
+    public function ActionAdd(){
+        $post  =$this->request->post();
+
+        $pageid = isset($post['menuid']) ? intval($post['menuid']) : "";
+        if($pageid==""){
+            return error_show(1001,'页面id不能为空');
+        }
+        $code = isset($post['action_code']) ? trim($post['action_code']) : "";
+
+        $status = isset($post['status']) ? intval($post['status']) : 1;
+        if($code==""){
+            return error_show(1002,'功能code不能为空');
+        }
+        try{
+            $where = ['menuid'=>$pageid,'action_code'=>$code];
+            $true =Db::name("action")->where($where)->find();
+            $data = ['menuid'=>$pageid,'action_code'=>$code,'status'=>$status,"updatetime"=>date("Y-m-d H:i:s"),"addtime"=>date("Y-m-d H:i:s")];
+            if($true){
+                return error_show(1003,'此功能已存在');
+            }else{
+                Db::name("action")->insert($data);
+                return app_show(0,"添加成功");
+            }
+        }catch (\Exception $e){
+            return error_show(1005,$e->getMessage());
+        }
+    }
+
+    /**
+     * @return \think\response\Json
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function index(){
+        $post  =$this->request->post();
+        $data = Db::name("admin_menu")->where(["pid"=>0,"status"=>1,"is_del"=>0])->select();
+        $result = [];
+        if(empty($data)){
+            return app_show(0,"获取成功",$result);
+        }
+        foreach ($data as $key=>$val){
+            $val["child"]=[];
+            $result[$val['id']] =$val;
+        }
+
+        $child =Db::name("admin_menu")->where([["pid","<>",0],['status',"=",1],["is_del","=",0]])->select();
+        foreach ($child as $k=>$value){
+            // $act = PasAction::all(['menuid'=>$value['id'],"status"=>1]);
+            $act =Db::name("action")->alias("a")->leftJoin("action_list l","a.action_code=l.action_code")->field
+            ("a.*,action_name")->where(['a.menuid'=>$value['id'],"a.status"=>1])->select();
+            $act_data = Db::name("action_field")->where(['menuid'=>$value['id'],"status"=>1])->select();
+            $value['action'] = $act;
+            $value['action_data'] = $act_data;
+            if(array_key_exists($value['pid'],$result)){
+                $result[$value['pid']]["child"][]=$value;
+            }
+        }
+
+        return app_show(0,"获取成功",array_values($result));
+    }
+
+    /**@param id menu 主键id
+     * @return \think\response\Json
+     * @throws \think\exception\DbException
+     */
+    public function ActionInfo(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $id = isset($post['id'])? intval($post['id']) :"";
+        if($id==""){
+            return error_show(1002,'功能id不能为空');
+        }
+        $menu =  Db::name("action_list")->where("id","=",$id)->find();
+        if(empty($menu)){
+            return error_show(1003,"未找到对应的数据");
+        }
+        return app_show(0,"获取成功!",$menu);
+    }
+}

+ 192 - 0
app/admin/controller/Cloud.php

@@ -0,0 +1,192 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\BaseController;
+use think\App;
+use think\console\command\Make;
+use think\facade\Db;
+
+class Cloud extends BaseController
+{
+public $post = "";
+public function __construct(App $app)
+{
+    parent::__construct($app);
+    $this->post = $this->request->post();
+}
+    public function upload(){
+        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+    $effect = VerifyTokens($token);
+    if(!empty($effect)&& $effect['code']!=0){
+        return error_show($effect['code'],$effect['message']);
+    }
+    $files = $this->request->file('image');
+    $list="";
+    if($files!=""){
+        $list = UploadImg($files);
+    }
+    if(is_array($list) &&!empty($list)){
+        return app_show(0,"上传成功",$list);
+    }else{
+        return app_show(1005,"上传失败".$list);
+    }
+    }
+public function create(){
+    $token= isset($this->post['token'])&& $this->post['token'] !==""? trim($this->post['token']) :"";
+    $bugNo = isset($this->post['bugNo']) && $this->post['bugNo'] !=="" ? trim($this->post['bugNo']) :"";
+    if($bugNo==""){
+        return error_show(1002,"参数bugNo不能为空");
+    }
+    $str=Db::name('note')->where(['bugNo'=>$bugNo])->find();
+    if(empty($str)){
+        return error_show(1002,"未找到数据");
+    }
+    $talk_note = isset($this->post['talk_note']) && $this->post['talk_note'] !=="" ? trim($this->post['talk_note']) :"";
+    if($talk_note==""){
+        return error_show(1002,"参数talk_note不能为空");
+    }
+//    $is_edit = isset($this->post['is_edit']) && $this->post['is_edit'] !=="" ? intval($this->post['is_edit']) :"";
+//    if ($is_edit==""){
+//        return error_show(1002,"参数is_edit不能为空");
+//    }
+
+    $apply_id =GetUserInfo($token);
+    if(empty($apply_id)||$apply_id['code']!=0){
+        return error_show(1002,"申请人数据不存在");
+    }
+    $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+    $ri= isset($apply_id["data"]['nickname']) ?  $apply_id["data"]['nickname'] : "";
+    $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']) :"1";
+    $data = [
+        "talk_name"=>$ri,
+        "talk_id"=>$rm,
+        "talk_note"=>$talk_note,
+        "bugNo"=>$bugNo,
+        "status"=>$status,
+        "is_del"=>0,
+       // "is_edit"=>$is_edit,
+        "addtime"=>date("Y-m-d H:i:s"),
+        "updatetime"=>date("Y-m-d H:i:s")
+    ];
+    $datainfo = Db::name('talk')->insert($data);
+    if($datainfo){
+        return error_show(0,"添加成功");
+    }else{
+        return error_show(1002,"添加失败");
+    }
+}
+public function list(){
+    $token= isset($this->post['token']) && $this->post['token'] !=="" ? trim($this->post['token']) :"";
+   // var_dump($this->post);
+    $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']):"";
+    if($id==""){
+        return error_show(1002,"参数id不能为空");
+    }
+    $str=Db::name('note')->where(['id'=>$id])->find();
+    if(empty($str)){
+        return error_show(1002,"未找到数据");
+    }
+    $page = isset($this->post['page']) && $this->post['page'] !=="" ? intval($this->post['page']) :"1";
+    $size = isset($this->post['size']) && $this->post['size'] !=="" ? intval($this->post['size']) :"10";
+    $where =[['is_del','=',0],['bugNo',"=",$str['bugNo']]];
+    $talk_id = isset($this->post['talk_id']) && $this->post['talk_id']!==""? intval($this->post['talk_id']):"";
+    if($talk_id!==""){
+        $where[]=['talk_id','=',$talk_id];
+    }
+    $talk_name = isset($this->post['talk_name']) && $this->post['talk_name']!==""? intval($this->post['talk_name']):"";
+    if($talk_name!==""){
+        $where[]=["talk_name","like","%$talk_name%"];
+    }
+    $bugNo = isset($this->post['bugNo']) && $this->post['bugNo']!==""? trim($this->post['bugNo']):"";
+    if($bugNo!==""){
+        $where[]=["bugNo","like","%$bugNo%"];
+    }
+    $start = isset($this->post['start']) && $this->post['start']!=="" ? $this->post['start']:"";
+    if($start!==""){
+        $where[]=['addtime',">=",$start];
+    }
+    $end = isset($this->post['end']) && $this->post['end']!=="" ? $this->post['end']:"";
+    if($end!==""){
+        $where[]=['addtime',"<=",$end];
+    }
+
+    $count = Db::name('talk')->where($where)->count();
+    $total = ceil($count/$size);
+    $page = $page>$total ? $total:$page;
+    $list = Db::name('talk')->where($where)->page($page,$size)->order("addtime desc")->select();
+    $apply_id =GetUserInfo($token);
+   // var_dump($apply_id);
+    if(empty($apply_id)||$apply_id['code']!=0){
+        return error_show(1002,"申请人数据不存在");
+    }
+    $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+    $ri= isset($apply_id["data"]['nickname']) ?  $apply_id["data"]['nickname'] : "";
+    $data =[];
+    foreach ($list as $value){
+        $value['is_edit']=$value['talk_id']  !=$rm ?"1":"0";
+        $data[]=$value;
+    }
+    return app_show(0,"获取成功",['list'=>$data,"count"=>$count]);
+}
+public function edit(){
+    $token = isset($this->post['token']) && $this->post['token'] !==""? trim($this->post['token']):"";
+    $id = isset($this->post['id']) && $this->post['id'] !==""? intval($this->post['id']):"";
+    if($id==""){
+        return error_show(1002,"参数id 不能为空");
+    }
+    $info = Db::name("talk")->where(["id"=>$id,"is_del"=>0])->find();
+    if(empty($info)){
+        return error_show(1002,'未找到数据');
+    }
+    $bugNo = isset($this->post['bugNo']) && $this->post['bugNo'] !=="" ? trim($this->post['bugNo']) :"";
+    if($bugNo==""){
+        return error_show(1002,"参数bugNo不能为空");
+    }
+    $talk_note = isset($this->post['talk_note']) && $this->post['talk_note'] !=="" ? trim($this->post['talk_note']) :"";
+    if($talk_note==""){
+        return error_show(1002,"参数talk_note不能为空");
+    }
+    $apply_id =GetUserInfo($token);
+    if(empty($apply_id)||$apply_id['code']!=0){
+        return error_show(1002,"申请人数据不存在");
+    }
+    $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+    $ri= isset($apply_id["data"]['nickname']) ?  $apply_id["data"]['nickname'] : "";
+    $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']) :"";
+    $data = [
+        "id"=>$id,
+        "talk_name"=>$ri,
+        "talk_id"=>$rm,
+        "talk_note"=>$talk_note,
+        "bugNo"=>$bugNo,
+        "status"=>$status,
+        "is_del"=>0,
+        "updatetime"=>date("Y-m-d H:i:s")
+    ];
+    $datainfo = Db::name('talk')->where($info)->save($data);
+    if($datainfo){
+        return error_show(0,"更新成功");
+    }else{
+        return error_show(1002,"更新失败");
+    }
+}
+public function del(){
+    $id = isset($this->post['id']) && $this->post['id'] !==""? intval($this->post['id']) :"";
+    if($id==""){
+        return error_show(1002,"参数不能为空");
+    }
+    $info=Db::name('talk')->where(['id'=>$id,'is_del'=>0])->find();
+    if(empty($info)){
+        return error_show(1002,"未找到数据");
+    }
+    $str['is_del']=1;
+    $str['updatetime']=date("Y-m-d H:i:s");
+    $info=Db::name('talk')->where($info)->save($str);
+    return $info ? app_show(0,"删除成功") :error_show(1002,"删除失败");
+}
+
+}

+ 170 - 0
app/admin/controller/Deal.php

@@ -0,0 +1,170 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\BaseController;
+use think\facade\Db;
+use think\App;
+
+class Deal extends BaseController
+{
+    public $post="";
+    public function __construct(App $app)
+    {
+        parent::__construct($app);
+        $this->post=$this->request->post();
+    }
+public function create(){
+    $token = isset($this->post['token']) && $this->post['token'] !=="" ?trim($this->post['token']):"";
+    $bugNo = isset($this->post['bugNo']) && $this->post['bugNo'] !=="" ? trim($this->post['bugNo']) :"";
+    if($bugNo==""){
+        return error_show(1002,"参数bugNo不能为空");
+    }
+    $apply_id =GetUserInfo($token);
+    if(empty($apply_id)||$apply_id['code']!=0){
+        return error_show(1002,"申请人数据不存在");
+    }
+    $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+    $ri= isset($apply_id["data"]['nickname']) ?  $apply_id["data"]['nickname'] : "";
+  //  $depart= isset($apply_id["data"]['department']) ?  $apply_id["data"]['department'] : "";
+        $level = isset($this->post['level']) && $this->post['level'] !==""? trim($this->post['level']):"";
+        $type = isset($this->post['type']) && $this->post['type'] !==""? intval($this->post['type']):"0";
+        $status = isset($this->post['status']) && $this->post['status']!=="" ? intval($this->post['status']):"1";
+        $data=[
+           "bugNo"=>$bugNo,
+          "deal_name"=>$ri,
+          "deal_id"=>$rm,
+         // "depart"=>$depart,
+          "level"=>$level,
+          "type"=>$type,
+          "status"=>$status,
+          "is_del"=>0,
+          "addtime"=>date("Y-m-d H:i:s"),
+          "updatetime"=>date("Y-m-d H:i:s")
+        ];
+        $datainfo=Db::name('deal')->insert($data);
+        if($datainfo){
+            return error_show(0,"新建成功");
+        }else{
+            return error_show(1002,"新建失败");
+        }
+    }
+    public function add(){
+        $token = isset($this->post['token']) && $this->post['token'] !==""? trim($this->post['token']) :"";
+       // var_dump($this->post);
+        $id = isset($this->post['id']) ? intval($this->post['id']) : "";
+        if($id==""){
+            return error_show(1001,'参数id不能为空');
+        }
+        $info = Db::name("note")->where(["id"=>$id,"is_del"=>0])->find();
+        if(empty($info)){
+            return error_show(1002,'未找到数据');
+        }
+        $company_type = isset($this->post['company_type']) && $this->post['company_type'] !=="" ?trim($this->post['company_type']):"";
+        if($company_type==""){
+            return error_show(1002,"参数company_type不能为空");
+        }
+        $deal_id = isset($this->post['deal_id']) && $this->post['deal_id'] !==""? intval($this->post['deal_id']) :"";
+        if ($deal_id==""){
+            $str['is_del']=1;
+            $str['updatetime']=date("Y-m-d H:i:s");
+            $inf=Db::name('deal')->where(['bugNo'=>$info['bugNo'],'status'=>0,"is_del"=>0])->save($str);
+            return $inf ? app_show(0,"编辑成功") :error_show(1002,"编辑失败");
+        }
+        else{
+            $to= GetInfoById($token,['id'=>$deal_id]);
+            if((!empty($to) && $to['code']!=0) ||empty($to) ){
+                return error_show($to['code'],$to['message']);
+            }
+            $datai=[];
+            $in = $to['data'];
+            $datai['deal_name'] = $in['nickname'];
+            $datai['deal_id'] = $in['id'];
+            $datai['bugNo'] = $info['bugNo'];
+            $datai['is_del'] = 0;
+            $datai['addtime'] = date("Y-m-d H:i:s");
+            $datai['updatetime'] = date("Y-m-d H:i:s");
+            $data= Db::name('deal')->insert($datai);
+            if($data){
+                return error_show(0,"添加成功");
+            }else{
+                return error_show(1002,"添加失败");
+            }
+        }
+    }
+//    public function list(){
+//        $where =[['is_del','=',0]];
+//        $deal_name = isset($this->post['deal_name']) && $this->post['deal_name'] !== "" ? trim($this->post['deal_name']) : "";
+//        if ($deal_name !== "") {
+//            $where[]= ["deal_name",'like',"%$deal_name%"];
+//        }
+//        $list=Db::name('deal')->where($where)->order("addtime desc")->select();
+//        return app_show(0,"获取成功",['list'=>$list]);
+//    }
+//    public function select(){
+//        $company_type = isset($this->post['company_type']) && $this->post['company_type']!==""? trim($this->post['company_type']):"";
+//        if ($company_type== "") {
+//            return error_show(1002,"参数company_type不能为空");
+//        }
+//        $info = Db::name('note')->where(['is_del'=>0])->field("model_id")->select();
+//        foreach ($info as $value){
+//            $value['can']= isset($value['model_id']) && $value['model_id'] !=0 ? made($value['model_id']):[];
+//            $data[]=$value;
+//        }
+//        return app_show(0,"获取成功",$data);
+//    }
+    public function   MenuAllList(){
+        $company_type = isset($this->post['company_type']) && $this->post['company_type']!==""? trim($this->post['company_type']):"";
+        if ($company_type== "") {
+            return error_show(1002,"参数company_type不能为空");
+        }
+        $company_name = isset($this->post['company_name']) && $this->post['company_name']!==""? trim($this->post['company_name']):"";
+        $data = Db::name("model")->where(['company_type'=>$company_type,'pid'=>0,'is_del'=>0])->select();
+        $l=[];
+        foreach ($data as $key=>$value){
+            $temp=[];
+            $temp =  Db::name("model")->where(['pid'=>$value['id'],'is_del'=>0])
+                ->select();
+            $value['child']=$temp;
+            $l[]=$value;
+        }
+        return app_show(0,"获取成功",$l);
+    }
+//    public function status(){
+//        $id = isset($this->post['id']) ? intval($this->post['id']) : "";
+//        if($id==""){
+//            return error_show(1001,'参数id不能为空');
+//        }
+//        $info = Db::name("deal")->where(["id"=>$id,"is_del"=>0])->find();
+//        if(empty($info)){
+//            return error_show(1002,'未找到数据');
+//        }
+//        $status = isset($this->post['status'])&&$this->post['status']!=='' ? intval($this->post['status']) : "0";
+//        if($status===""){
+//            return error_show(1001,'参数status不能为空');
+//        }
+//        $level = isset($this->post['level']) && $this->post['level']!==""? trim($this->post['level']):"1";
+//        if($level==""){
+//            return error_show(1001,'参数level不能为空');
+//        }
+//        $type = isset($this->post['type'])&&$this->post['type']!=='' ? intval($this->post['type']) : "0";
+//        if($type==""){
+//            return error_show(1001,'参数type不能为空');
+//        }
+//        $deal_name= isset($this->post['deal_name'])&&$this->post['deal_name']!=='' ? intval($this->post['deal_name']) : "";
+//        if($deal_name==""){
+//            return error_show(1001,'参数deal_name不能为空');
+//        }
+//        $info['status']= $status;
+//        $info['deal_name']= $deal_name;
+//        $info['level']= $level;
+//        $info['type']= $type;
+//        $info['updatetime']=date("Y-m-d H:i:s");
+//        $up = Db::name("deal")->update($info);
+//        if($up){
+//            return app_show(0,"更新成功");
+//        }else{
+//            return error_show(1005,"更新失败");
+//        }
+//    }
+}

+ 163 - 0
app/admin/controller/Departuser.php

@@ -0,0 +1,163 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\BaseController;
+use think\App;
+use think\facade\Db;
+class Departuser extends BaseController
+{
+    public $post = "";
+    public function __construct(App $app)
+    {
+        parent::__construct($app);
+        $this->post = $this->request->post();
+        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+    }
+    /*列表*/
+    public function list(){
+        $page = isset($this->post['page']) && $this->post['page'] != "" ? intval($this->post['page']) : 1;
+        $size = isset($this->post['size']) && $this->post['size'] != "" ? intval($this->post['size']) : 10;
+        $us=[];
+        $count = Db::name("depart_user")->where($us)->count();
+        $page>=ceil($count/$size) ? $page=ceil($count/$size) :"";
+        $list =  Db::name("depart_user")->alias('b')->join('company_item a','a.id=b.itemid','left')
+            ->field('a.name,b.itemid,b.uid,b.nickname')->where($us)->page($page,$size)->select();
+//        $i=[];
+//        foreach ($list as $p){
+//            $tips = Db::name('depart_tips')->where(['is_del'=>0,'depart_uid'=>$p['uid']])->select();
+//            $p['total_tips']=$tips;
+//            $i[]=$p;
+//        }
+        return app_show(0, '信息获取成功', ['list' => $list, 'count' => $count]);
+    }
+    /*添加*/
+    public function attend(){
+
+        $uid = isset($this->post['uid']) && $this->post['uid'] !==""? trim($this->post['uid']):"";
+        if($uid==""){
+            return error_show(1004,"员工id不能为空");
+        }
+        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+        $to= GetInfoById($token,['id'=>$uid]);
+        if(empty($to)||$to['code']!=0){
+            return app_show(1002,"员工信息不存在");
+        }
+        $nickname = isset($to['data']['nickname']) &&$to['data']['nickname']!="" ? $to['data']['nickname'] :"" ;
+        $itemid = isset($this->post['itemid']) && $this->post['itemid'] !==""? trim($this->post['itemid']):"";
+        if($itemid==""){
+            return error_show(1004,"部门不能为空");
+        }
+        $repeat_itemid = Db::name("depart_user")->where(["is_del"=>0,"itemid"=>$itemid,"uid"=>$uid])->find();
+        if(!empty($repeat_itemid)){
+            return error_show(1004,"部门用户已存在");
+        }
+        $tid = Db::name('company_item')->where(['id'=>$itemid,'is_del'=>0])->find();
+        //var_dump( Db::name('company_item')->getLastSql());
+        if(empty($tid)){
+            return error_show(1004,"部门不存在");
+        }
+        $status = isset($this->post['status']) && $this->post['status'] !==""? trim($this->post['status']) : "1";
+        if($status==""){
+            return error_show(0,"状态不能为空");
+        }
+        Db::startTrans();
+        try{
+            $data = [
+                'uid'=>$uid,'nickname'=>$nickname,'itemid'=>$itemid,
+                'is_del'=>0,'status'=>$status,
+                'addtime'=>date("Y-m-d H:i:s"),
+                'updatetime'=>date("Y-m-d H:i:s")
+            ];
+            $str=Db::name('depart_user')->insert($data);
+            if($str){
+                Db::commit();
+                return error_show(0,"添加成功");
+            }else{
+                Db::rollback();
+                return error_show(1002,"添加失败");
+            }
+        }catch (\Exception $e){
+            return error_show(1003,$e->getMessage());
+        }
+    }
+    /*编辑*/
+    public function useredit(){
+        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+
+        $id = isset($this->post['id']) &&$this->post['id'] !==""? trim($this->post['id']):"";
+        if($id ==""){
+            return error_show(1004,"id不能为空");
+        }
+        $nid = Db::name('depart_user')->where(['id'=>$id,'is_del'=>0])->find();
+        if(empty($nid)){
+            return error_show(1004,"id不能为空");
+        }
+        $uid = isset($this->post['uid']) && $this->post['uid'] !==""? trim($this->post['uid']):"";
+        if($uid ==""){
+            return error_show(1004,"员工id不能为空");
+        }
+        $to= GetInfoById($token,['id'=>$uid]);
+        if(empty($to)||$to['code']!=0){
+            return app_show(1002,"员工信息不存在");
+        }
+        $nickname = isset($to['data']['nickname']) &&$to['data']['nickname']!="" ? $to['data']['nickname'] :"" ;
+        $itemid = isset($this->post['itemid']) && $this->post['itemid'] !==""?($this->post)['itemid']: "";
+        if($itemid==""){
+            return error_show(1004,"部门id不能为空");
+        }
+        $repeat_itemid = Db::name("depart_user")->where(["is_del"=>0,"itemid"=>$itemid,"uid"=>$uid])->where('id','<>',$id)->find();
+        if(!empty($repeat_itemid)){
+            return error_show(1004,"部门用户已存在");
+        }
+        try{
+            $d=[
+                'uid'=>$uid,'itemid'=>$itemid,'nickname'=>$nickname,
+                'is_del'=>0,'addtime'=>date("Y-m-d H:i:s"),
+                'updatetime'=>date("Y-m-d H:i:s"),
+            ];
+            $r = Db::name("depart_user")->where(["is_del"=>0,"id"=>$id])->save($d);
+            // var_dump( Db::name("depart_user")->getLastSql());
+            return  $r ? app_show(0,"信息更新成功"): error_show(1003,"信息更新失败");
+        }catch (\Exception $e){
+            return error_show(1003,$e->getMessage());
+        }
+    }
+    /*查询*/
+    public function found(){
+        $id = isset($this->post['id'])&& $this->post['id'] !==""? trim($this->post['id']) : "";
+        if($id==""){
+            return error_show(1004,'员工不能为空');
+        }
+
+        $fo = Db::name('depart_user')->alias('a')->join('company_item b',"b.id=a.id",'left')
+            ->field('a.*,b.name')->where(['uid'=>$id,'a.is_del'=>0,'b.is_del'=>0])->find();
+        // var_dump( Db::name('depart_user')->getLastSql());
+        if(empty($fo)){
+            return error_show(1004,"信息获取失败");
+        }
+//        $fi = Db::name('depart_tips')->field('year,month,total_tips')->where(['depart_uid'=>$id,'is_del'=>0])->select();
+//        $fo['depart_user']=$fi;
+        return app_show(0,"获取成功",$fo);
+    }
+    /*删除*/
+    public function userdel(){
+        $id = isset($this->post['id']) && $this->post['id'] !==""? trim($this->post['id']) :"";
+        $de = Db::name('depart_user')->where(['is_del'=>0,'id'=>$id])->find();
+        if($de==false){
+            return error_show(1004,"员工信息不存在");
+        }
+        $de['is_del']=1;
+        $de['updatetime']= date("Y-m-d H:i:s");
+        $back = Db::name('depart_user')->save($de);
+        // var_dump(Db::name('depart_user')->getLastSql());
+        return $back ? app_show(0,"删除成功") :error_show(1004,"删除失败");
+    }
+}

+ 84 - 0
app/admin/controller/Login.php

@@ -0,0 +1,84 @@
+<?php
+
+namespace app\admin\controller;
+
+use think\Request;
+
+class Login
+{
+    /**
+     * 显示资源列表
+     *
+     * @return \think\Response
+     */
+    public function index()
+    {
+
+    }
+
+    /**
+     * 显示创建资源表单页.
+     *
+     * @return \think\Response
+     */
+    public function create()
+    {
+        //
+    }
+
+    /**
+     * 保存新建的资源
+     *
+     * @param  \think\Request  $request
+     * @return \think\Response
+     */
+    public function save(Request $request)
+    {
+        //
+    }
+
+    /**
+     * 显示指定的资源
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function read($id)
+    {
+        //
+    }
+
+    /**
+     * 显示编辑资源表单页.
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function edit($id)
+    {
+        //
+    }
+
+    /**
+     * 保存更新的资源
+     *
+     * @param  \think\Request  $request
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function update(Request $request, $id)
+    {
+        //
+    }
+
+    /**
+     * 删除指定资源
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function delete($id)
+    {
+        //
+    }
+}

+ 168 - 0
app/admin/controller/Manange.php

@@ -0,0 +1,168 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\admin\model\NoteLog;
+use app\BaseController;
+use think\App;
+use think\facade\Config;
+use think\facade\Db;
+
+class Manange extends BaseController
+{
+    public $post = "";
+
+    public function __construct(App $app)
+    {
+        parent::__construct($app);
+        $this->post = $this->request->post();
+    }
+
+    public function create()
+    {
+        $token = isset($this->post['token']) && $this->post['token'] !== "" ? trim($this->post['token']) : "";
+        $id = isset($this->post['id']) && $this->post['id'] !== "" ? $this->post['id'] : "";
+        if ($id == "") {
+            return error_show(1002, "参数id不能为空");
+        }
+        $company_id = isset($this->post['company_id']) && $this->post['company_id'] !== "" ? $this->post['company_id'] : "";
+        if ($company_id == "") {
+            return error_show(1002, "参数company_id不能为空");
+        }
+        $var = Db::name('manange')->where(['company_id' => $company_id,'is_del' => 0])->column("manange_id");
+        //var_dump( Db::name('manange')->getLastSql());
+        $str = array_diff($id, $var);
+        $datain=[];
+        if (!empty($str)) {
+            foreach ($str as $value){
+                $to = GetInfoById($token, ['id' => $value]);
+                if ((!empty($to) && $to['code'] != 0) || empty($to)) {
+                    return error_show($to['code'], $to['message']);
+                }
+                $datai = [];
+                $info = $to['data'];
+                $datai['manange_name'] = $info['nickname'];
+                $datai['manange_id'] = $info['id'];
+                $datai['phone'] = $info['mobile'];
+                $datai['company_id'] = $company_id;
+                $datai['is_del'] = 0;
+                $datai['addtime'] = date("Y-m-d H:i:s");
+                $datai['updatetime'] = date("Y-m-d H:i:s");
+                $datain[]=$datai;
+            }
+        }
+        $st = array_diff($var,$id);
+        $itep = Db::name('deal')->where(['deal_id'=>$st,'is_del'=>0])->select();
+        if(!empty($itep)){
+            $uin = array_unique(array_column($itep->toArray(),'deal_id'));
+            $infe=Db::name('manange')->where(['manange_id'=>$uin,"is_del"=>0,'company_id'=>$company_id])->column('manange_id,manange_name');
+            if(!empty($infe)){
+                return app_show(10002,"处理人已绑定任务无法删除",$infe);
+            }
+        }
+        Db::startTrans();
+        try{
+            if(!empty($st)){
+                $it['is_del']=1;
+                $it['updatetime'] = date("Y-m-d H:i:s");
+                $inf=Db::name('manange')->where(['manange_id'=>$st,"is_del"=>0,'company_id'=>$company_id])->save($it);
+                //var_dump(Db::name('manange')->getLastSql());
+                if(!$inf){
+                    Db::rollback();
+                    return error_show(1003, "更新失败");
+                }
+            }
+            if(!empty($datai)){
+                $datainfo = Db::name('manange')->insertAll($datain);
+                //var_dump(Db::name('manange')->getLastSql());
+                if (!$datainfo) {
+                    Db::rollback();
+                    return error_show(1002, "新建失败");
+                }
+            }
+            Db::commit();
+            return error_show(0, "新建成功");
+        }catch (\Exception $e){
+            Db::rollback();
+            return error_show(1004,$e->getMessage());
+        }
+}
+    public function del(){
+        $id = isset($this->post['id']) && $this->post['id'] !==""? intval($this->post['id']) :"";
+        if($id==""){
+            return error_show(1002,"参数不能为空");
+        }
+        $info=Db::name('manange')->where(['id'=>$id,'is_del'=>0])->find();
+        if(empty($info)){
+            return error_show(1002,"未找到数据");
+        }
+        $status = isset($this->post['status']) && $this->post['status'] !==""? intval($this->post['status']):"0";
+        if ($status==""){
+            return error_show(1002,"参数status不能为空");
+        }
+        $str['is_del']=1;
+        $str['status']=$status;
+        $str['updatetime']=date("Y-m-d H:i:s");
+        $info=Db::name('manange')->where($info)->save($str);
+        return $info ? app_show(0,"删除成功") :error_show(1002,"删除失败");
+    }
+public function list(){
+    $where =[['is_del','=',0]];
+    $manange_name = isset($this->post['manange_name']) && $this->post['manange_name'] !== "" ? trim($this->post['manange_name']) : "";
+    if ($manange_name !== "") {
+        $where[]= ['manange_name',"like","%$manange_name%"];
+    }
+    $manange_id = isset($this->post['manange_id']) && $this->post['manange_id'] !== "" ? trim($this->post['manange_id']) : "";
+    if ($manange_id !== "") {
+        $where[]= ['manange_id',"like","%$manange_id%"];
+    }
+    $company_id = isset($this->post['company_id']) && $this->post['company_id'] !== "" ? $this->post['company_id'] : "";
+    if ($company_id !== "") {
+        $where[]= ['company_id',"=",$company_id];
+    }
+    $phone= isset($this->post['phone']) && $this->post['phone'] !== "" ? intval($this->post['phone']) : "";
+    if ($phone !== "") {
+        $where[]= ['phone',"like","%$phone%"];
+    }
+    $status= isset($this->post['status']) && $this->post['status'] !== "" ? intval($this->post['status']) : "";
+    if ($status !== "") {
+        $where[]= ['status',"=",$status];
+    }
+    $list=Db::name('manange')->where($where)->order("addtime desc")->select();
+        return app_show(0,"获取成功",$list);
+    }
+public function loglist(){
+    $page = isset($this->post['page']) && $this->post['page']!==""? intval($this->post['page']) :"1";
+    $size = isset($this->post['size']) && $this->post['size']!==""? intval($this->post['size']) :"10";
+    $where=[];
+    $bugNo= isset($this->post['bugNo']) && $this->post['bugNo']!="" ? trim($this->post['bugNo']):"";
+    if($bugNo!=""){
+        $where[]=['bugNo',"like","%$bugNo%"];
+    }
+    $conf=Config::get('note');
+    $count = Db::name('note_log')->where($where)->count();
+    $total = ceil($count/$size);
+    $page = $total>=$page ? $page :$total;
+    $list = Db::name('note_log')->where($where)->page($page,$size)->order("addtime desc")
+        ->select();
+    $data=[];
+    foreach ($list as $value){
+        $value['type_cn'] = $value['type']==2?'编辑':'新建';
+        if(array_key_exists($value['handle_name'],$conf['field_value'])){
+            $field_value=$conf['field_value'][$value['handle_name']];
+            $value['action_item'] =  isset($field_value[$value['action_item']]) ?$field_value[$value['action_item']]:$value['action_item'];
+            $value['action_after'] = isset($field_value[$value['action_after']]) ?$field_value[$value['action_after']]:$value['action_after'];
+        }else{
+            if($value['handle_name']=='model_id'){
+                $model1 = made($value['action_item']);
+                $model2 = made($value['action_after']);
+                $value['action_item'] = empty($model1)?'': implode("/",array_column($model1,'rename'));
+                $value['action_after'] = empty($model2)?'': implode("/",array_column($model2,'rename'));
+            }
+        }
+        $value['handle_name'] = $conf['field'][$value['handle_name']];
+        $data[]=$value;
+    }
+    return app_show(0,"获取成功",['list'=>$data,'count'=>$count]);
+}
+}

+ 261 - 0
app/admin/controller/Menu.php

@@ -0,0 +1,261 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\controller;
+
+use app\BaseController;
+use think\App;
+use think\facade\Db;
+use think\Request;
+
+class Menu extends BaseController
+{
+    public $post="";
+    private $uid = '';
+    /**
+     * 显示资源列表
+     *
+     * @return \think\Response
+     */
+    public  function __construct(App $app)
+    {
+        parent::__construct($app);
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $this->uid = isset($effetc['data']['user']['id']) ? $effetc['data']['user']['id'] :"";
+    }
+
+    public function list()
+    {
+        $post=$this->request->post();
+        $uid = $this->uid;
+        if($uid==''){
+            return error_show(101,'未找到用户信息');
+        }
+        $roleid = Db::name("user_role")->where([["uid","=",$uid],["status","=",1],["is_del","=",0]])->find();
+       //var_dump(Db::name("user_role")->getLastSql());
+        if(empty($roleid)){
+            return error_show(1004,'未找到用户权限信息');
+        }
+        $role = Db::name("role_action")->where("role_id","=", $roleid['roleid'])->find();
+        if($role==false){
+            return app_show(0,"获取成功",[]);
+        }
+        $data= Db::name("view_menu")->where('aid',"in",explode(",",$role['action_conllect']))->where(['status'=>1,"cstatus"=>1,"is_display"=>1])
+            ->order("weight desc,id asc,cweight desc,cid asc")->select();
+        //var_dump(Db::name("view_menu")->getLastSql());
+
+        $list=[];
+        $act=[];
+        foreach ($data as $value){
+            $list[$value["id"]]['menu_name']=$value['menu_name'];
+            $list[$value["id"]]['menu_img']=$value['menu_img'];
+            $list[$value["id"]]['menu_route']=$value['menu_route'];
+            $list[$value["id"]]['is_display']=$value['is_display'];
+            $list[$value["id"]]['status']=$value['status'];
+            $temp = [];
+            $temp['menu_name']=$value['cname'];
+            $temp['menu_img']=$value['cmenu_img'];
+            $temp['menu_route']=$value['cmenu_route'];
+            $temp['menu_url']=$value['cmenu_url'];
+            $temp['menu_url']=$value['cmenu_url'];
+            $temp['status']=$value['cstatus'];
+            $temp['is_private']=$value['cprivate'];
+            $temp['is_display']=$value['cis_display'];
+            $list[$value["id"]]['child'][$value['cid']]=$temp;
+            $act[$value['id']][$value['cid']][]=$value['acode'];
+            $list[$value["id"]]['child'][$value['cid']]['action']= $act[$value['id']][$value['cid']];
+
+        }
+        array_walk($list,function (&$value){
+            $value['child']= array_values($value['child']);
+        });
+        return app_show(0,"获取成功",array_values($list));
+    }
+
+    /**
+     * 显示创建资源表单页.
+     *
+     * @return \think\Response
+     */
+    public function MenuEdit(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $id = isset($post['id']) ?intval($post['id']) :"";
+        if($id!=""){
+            $menu = Db::name("admin_menu")->where("id","=",$id)->find();
+            if($menu==false){
+                return error_show(1003,"菜单不信息不存在");
+            }
+        }
+        $name = isset($post['name']) ?trim($post['name']) :"";
+        if($name==""){
+            return error_show(1002,"菜单名称不能为空");
+        }
+        $url = isset($post['url']) ?trim($post['url']) :"";
+        $route = isset($post['route']) ?trim($post['route']) :"";
+        $code = isset($post['menu_code']) ?trim($post['menu_code']) :"";
+        $img = isset($post['img']) ?trim($post['img']) :"";
+        $pid = isset($post['pid']) ?intval($post['pid']) :0;
+        $weight = isset($post['weight']) ?floatval($post['weight']) :1;
+        $status = isset($post['is_show']) ? intval($post['is_show']) : 0;
+        $is_display = isset($post['is_display']) ? intval($post['is_display']) : 0;
+        $private = isset($post['private']) ?intval($post['private']) :(isset($menu['is_private']) ?
+            $menu['is_private'] : 0);
+        if($pid!=0 && $route==""){
+            return error_show(1002,"子级菜单路由不能为空");
+        }
+        $data=[
+            "menu_name"=>$name,
+            "menu_url"=>$url,
+            "menu_route"=>$route,
+            "menu_code"=>$code,
+            "menu_img"=>$img,
+            "pid"=>$pid,
+            'is_show'=>$status,
+            'is_display'=>$is_display,
+            "is_private"=>$private,
+            'status'=>1,
+            "weight"=>$weight,
+            "updatetime"=>date("Y-m-d H:i:s"),
+        ];
+        $message="新建";
+        if($id!=""){
+            $message="编辑";
+            $data['id']=$id;
+        }
+        $result = Db::name("admin_menu")->save($data);
+//        $orde = ["order_code"=>$code,"status"=>0,"action_remark"=>'',"action_type"=>"edit"];
+//        ActionLog::logAdd($token,$orde,"admin_menu",0,$orde);
+        return $result ? app_show(0,"{$message}成功"): error_show(1003,"{$message}失败");
+    }
+
+    /**
+     * 保存新建的资源
+     *
+     * @param  \think\Request  $request
+     * @return \think\Response
+     */
+    public function MenuStatus(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $id = isset($post['id']) ?intval($post['id']) :"";
+        $menu = Db::name("admin_menu")->where("id","=",$id)->find();
+        if($menu==false){
+            return error_show(1003,"菜单信息不存在");
+        }
+        $statu = isset($post['status'])&&$post['status']!="" ? intval($post['status']) :"";
+        if($statu===""){
+            return error_show(1003,"菜单状态不能为空");
+        }
+       // $var= $menu['status'];
+        $menu['status']=$statu;
+        $menu['updatetime']=date("Y-m-d H:i:s");
+        $result = Db::name("admin_menu")->save($menu);
+//        $orde = ["order_code"=>$menu['menu_name'],"status"=>$var,"action_remark"=>'',"action_type"=>"edit"];
+//        ActionLog::logAdd($token,$orde,"admin_menu", $menu['status'],$orde);
+        return $result ? app_show(0,"状态更新成功"): error_show(1003,"状态更新失败");
+    }
+
+    /**
+     * @return \think\response\Json|void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function   MenuAllList(){
+        $post  =$this->request->post();
+
+        $data = Db::name("admin_menu")->where(['pid'=>0,'is_del'=>0])->order("weight desc,id asc")->select();
+        $l=[];
+        foreach ($data as $key=>$value){
+            $temp=[];
+            $temp =  Db::name("admin_menu")->where(['pid'=>$value['id'],'is_del'=>0])->order("weight desc,id asc")
+                ->select();
+            $value['child']=$temp;
+            $l[]=$value;
+        }
+        return app_show(0,"获取成功",$l);
+    }
+
+    /**
+     * @return \think\response\Json|void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function MenuDel(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $id = isset($post['id']) ?intval($post['id']) :"";
+        $menu =  Db::name("admin_menu")->where("id","=",$id)->find();
+        if($menu==false){
+            return error_show(1003,"菜单不信息不存在");
+        }
+//        $var=$menu['status'];
+        $menu['is_show']=0;
+        $menu['status']=0;
+        $menu['is_del']=1;
+        $menu['updatetime']=date("Y-m-d H:i:s");
+        $result =  Db::name("admin_menu")->save($menu);
+//        $orde = ["order_code"=>$menu['menu_name'],"status"=>$var,"action_remark"=>'',"action_type"=>"delete"];
+//        ActionLog::logAdd($token,$orde,"admin_menu", $menu['status'],$orde);
+        return $result ? app_show(0,"删除成功"): error_show(1003,"删除失败");
+    }
+
+    /**
+     * @return \think\response\Json|void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function MenuActionDel(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $id = isset($post['id']) ?intval($post['id']) :"";
+        $menu =  Db::name("action")->where("id","=",$id)->find();
+        if($menu==false){
+            return error_show(1003,"菜单功能信息不存在");
+        }
+
+        $result =  Db::name("action")->delete($menu);
+        return $result ? app_show(0,"删除成功"): error_show(1003,"删除失败");
+    }
+}

+ 162 - 0
app/admin/controller/Model.php

@@ -0,0 +1,162 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\BaseController;
+use think\App;
+use think\facade\Db;
+
+class Model extends BaseController
+{
+public $post="";
+public function __construct(App $app)
+{
+    parent::__construct($app);
+    $this->post=$this->request->post();
+}
+public function list(){
+    $where=[["is_del","=",0]];
+    $name = isset($this->post['name']) && $this->post['name'] !==""? trim($this->post['name']):"";
+    if($name!==""){
+        $where[]=["name","like","%$name%"];
+    }
+    $pid = isset($this->post['pid']) && $this->post['pid'] !==""?intval($this->post['pid']) :"";
+    if($pid!==""){
+        $where[]=["pid","=",$pid];
+    }
+    $level = isset($this->post['level']) && $this->post['level'] !==""? intval($this->post['level']):"";
+    if($level!==""){
+        $where[]=["level","=",$level];
+    }
+    $status = isset($this->post['status']) && $this->post['status'] !==""? intval($this->post['status']):"";
+    if ($status!==""){
+        $where[]=["status","=",$status];
+    }
+    $company_type = isset($this->post['company_type']) && $this->post['company_type'] !==""? intval($this->post['company_type']):"";
+    if ($company_type!==""){
+        $where[]=["company_type","=",$company_type];
+    }
+    $list = Db::name('model')->where($where)->order("addtime desc")->select();
+    $data=[];
+    foreach ($list as $value){
+        $temp =  Db::name("model")->where(['pid'=>$value['id'],'is_del'=>0])->order("addtime desc")->select();
+        $value['child']=$temp;
+        $data[]=$value;
+    }
+    return app_show(0,"获取成功",$data);
+}
+//public function create(){
+//    $name = isset($this->post['name']) && $this->post['name'] !=="" ? trim($this->post['name']):"";
+//    if($name==""){
+//        return error_show(0,"参数name不能为空");
+//    }
+//    $level = isset($this->post['level']) && $this->post['level'] !== "" ? intval($this->post['level']) : "";
+//    $rename = Db::name('model')->where(['name'=>$name,'level'=>$level,'is_del'=>0])->find();
+//    if(!empty($rename)){
+//        return error_show(1002,"模块名称已存在");
+//    }
+//    $pid = isset($this->post['pid']) && $this->post['pid'] !=="" ? trim($this->post['pid']) :"";
+//    if($pid===""){
+//        return error_show(1002,"父级id不能为空");
+//    }
+//    if($pid!=0){
+//        $spid = Db::name('model')->where(['id'=>$pid, 'is_del'=>0])->find();
+//        if(empty($spid)){
+//            return error_show(1004,"父级不能为空");
+//        }
+//    }
+//
+//    $level =1;
+//    if ($pid !== 0) {
+//        $levl=Db::name('model')->where(['id'=>$pid])->find();
+//        if(empty($levl)){
+//            return error_show(1002,"未找到父级数据");
+//        }
+//        $level =$levl['level']+1;
+//    }
+//    $status= isset($this->post['status']) && $this->post['status'] !==""?intval($this->post['status']):"1";
+//    $data = [
+//        "name"=>$name,
+//        "pid"=>$pid,
+//        "status"=>$status,
+//        "level"=>$level,
+//        "is_del"=>0,
+//        "addtime"=>date("Y-m-d H:i:s"),
+//        "updatetime"=>date("Y-m-d H:i:s")
+//    ];
+//    $datainfo = Db::name('model')->insert($data);
+//    if($datainfo){
+//        return error_show(0,"添加成功");
+//    }else{
+//        return error_show(1002,"添加失败");
+//    }
+//}
+
+//public function edit(){
+//    $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']) :"";
+//    if($id==""){
+//        return error_show(1002,"参数id不能为空");
+//    }
+//    $info =Db::name('model')->where(['id'=>$id,'is_del'=>0])->find();
+//    if(empty($info)){
+//        return error_show(1004,"未找到数据");
+//    }
+//    $name = isset($this->post['name']) && $this->post['name'] !=="" ? trim($this->post['name']):"";
+//    if($name==""){
+//        return error_show(0,"参数name不能为空");
+//    }
+//    $level = isset($this->post['level']) && $this->post['level'] !== "" ? intval($this->post['level']) : "";
+//    $rename = Db::name('model')->where(['name'=>$name,'level'=>$level,'is_del'=>0])->find();
+//    if(!empty($rename)){
+//        return error_show(1002,"模块名称已存在");
+//    }
+//    $pid = isset($this->post['pid']) && $this->post['pid'] !=="" ? trim($this->post['pid']) :"";
+//    if($pid===""){
+//        return error_show(1002,"父级id不能为空");
+//    }
+//    if($pid!=0){
+//        $spid = Db::name('model')->where(['id'=>$pid, 'is_del'=>0])->find();
+//        if(empty($spid)){
+//            return error_show(1004,"父级不能为空");
+//        }
+//    }
+//    $status= isset($this->post['status']) && $this->post['status'] !==""?intval($this->post['status']):"1";
+//    $data = [
+//        "name"=>$name,
+//        "pid"=>$pid,
+//        "status"=>$status,
+//        "level"=>$level,
+//        "is_del"=>0,
+//        "addtime"=>date("Y-m-d H:i:s"),
+//        "updatetime"=>date("Y-m-d H:i:s")
+//    ];
+//    $datainfo=Db::name('model')->where($info)->save($data);
+//    if($datainfo){
+//        return error_show(0,"更新成功");
+//    }else{
+//        return error_show(1002,"更新失败");
+//    }
+//}
+//public function info(){
+//    $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']) :"";
+//    if($id==""){
+//        return error_show(1002,"参数id不能为空");
+//    }
+//    $idinfo = Db::name('model')->where(['id'=>$id,'is_del'=>0])->find();
+//    return app_show(0,"获取成功",$idinfo);
+//}
+//public function del(){
+//    $id = isset($this->post['id']) && $this->post['id'] !==""? intval($this->post['id']) :"";
+//    if($id==""){
+//        return error_show(1002,"参数不能为空");
+//    }
+//    $info=Db::name('model')->where(['id'=>$id,'is_del'=>0])->find();
+//    if(empty($info)){
+//        return error_show(1002,"未找到数据");
+//    }
+//    $str['is_del']=1;
+//    $str['updatetime']=date("Y-m-d H:i:s");
+//    $info=Db::name('model')->where($info)->save($str);
+//    return $info ? app_show(0,"删除成功") :error_show(1002,"删除失败");
+//}
+}

+ 285 - 0
app/admin/controller/Newfill.php

@@ -0,0 +1,285 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\BaseController;
+use think\App;
+use think\facade\Db;
+class Newfill extends BaseController
+{
+    public $post = "";
+
+
+
+    public function __construct(App $app)
+    {
+        parent::__construct($app);
+        $this->post = $this->request->post();
+    }
+    public function list()
+    {
+//        $page = isset($this->post['page']) && $this->post['page'] != "" ? intval($this->post['page']) : 1;
+//        $size = isset($this->post['size']) && $this->post['size'] != "" ? intval($this->post['size']) : 10;
+        $condition=[];
+        $depart []=['is_del',"=",0];
+        $condition[] = ['is_del',"=",0];
+        $pid =  isset($this->post['pid']) &&$this->post['pid']!=="" ?intval($this->post['pid']): "";
+        if($pid!==""){
+            $condition[]=["pid","=",$pid];
+
+        }
+        $name= isset($this->post['name'])&&$this->post['name']!=="" ? trim($this->post['name']):"";
+        if($name!=""){
+            $condition[]=["name","like","%{$this->post['name']}%"];
+        }
+        $nickname = isset($this->post['nickname']) && $this->post['nickname'] !==""? trim($this->post['nickname']) :"";
+        if($nickname!=""){
+            $is= Db::name("depart_user")->where([['nickname','like',"%{$nickname}%"]])->column('itemid');
+
+            if(empty($is)){
+                return error_show(1004,"未找到数据");
+            }
+            $condition[]=["id","in",$is];
+        }
+        if($pid==="" &&$name=="" &&$nickname==""){
+            $condition[]=["pid","=",0];
+        }
+        $pidlist = Db::name("company_item")->where($condition)->column("pid");
+        if(!empty($pidlist)){
+            $depart[]=[["itemid","in",$pidlist]];
+
+        }else{
+            if($pid===""){
+                $depart[]=['itemid','=',0];
+            }else{
+                $depart[]=['itemid','=',$pid];
+            }
+        }
+
+        $item = Db::name("depart_user")->where($depart)->select();
+        $list = Db::name("company_item")->where($condition)->select();
+        return app_show(0,"获取成功",["depart"=>$list,"item"=>$item]);
+    }
+    /*状态*/
+    public function stat(){
+        $id = isset($this->post['id'])?intval($this->post['id']):"";
+        if($id==""){
+            return error_show(1004,"参数id 不能为空");
+        }
+        $s = Db::name('company_item')->where(["id"=>$id])->find();
+        if(empty($s)){
+            return error_show(1005,"未找到部门");
+        }
+        $var= $s['status'];
+        $di = $s['status']==0? "1":"0";
+        $s['status']=$di;
+        $s['updatetime'] = date("Y-m-d H:i:s");
+        // var_dump($s);
+        $ti = Db::name('company_item')->save($s);
+        $orde = ["order_code"=>$s['name'],"status"=>$var,"action_remark"=>'',"action_type"=>"edit"];
+        ActionLog::logAdd($this->post['token'],$orde,"company_item",$s['status'],$orde);
+        return app_show(0,"更新成功");
+    }
+    /*职位*/
+    public function userp(){
+
+        $id = isset($this->post['id'])?intval($this->post['id']):"";
+        if($id==""){
+            return error_show(1004,"参数id不能为空");
+        }
+        $t = Db::name('depart_user')->where(["id"=>$id,"is_del"=>0])->find();
+        if(empty($t)){
+            return error_show(1005,"未找到用户");
+        }
+        $position = isset($this->post['position'])?intval($this->post['position']):"";
+        if($position==""){
+            return error_show(1004,"职位不能为空");
+        }
+        if($position==2){
+            $f = Db::name('depart_user')->where(['itemid'=>$t['itemid'],"is_del"=>0,"position"=>2])->find();
+            if(!empty($f)&& $f['id']!=$id){
+                $f['position']=1;
+                $f['updatetime']= date("Y-m-d H:i:s");
+                $m= Db::name('depart_user')->save($f);
+                if($m==false){
+                    Db::rollback();
+                    return error_show(1004,"负责人修改失败");
+                }
+            }
+        }
+        $t['position']=$position;
+        $t['updatetime'] = date("Y-m-d H:i:s");
+        //var_dump($t);
+        $ti = Db::name('depart_user')->save($t);
+        if($ti==true){
+            Db::commit();
+            return app_show(0,"修改成功");
+        }else{
+            Db::rollback();
+            return error_show(1004,"修改失败");
+        }
+    }
+    public function add(){
+        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $item_name=isset($this->post['name']) && $this->post['name'] !==""? trim($this->post['name']) :"";
+        if($item_name==""){
+            return error_show(0,"部门名称不能为空");
+        }
+        $repeat_name = Db::name("company_item")->where(["is_del"=>0,"name"=>$item_name])->find();
+        if(!empty($repeat_name)){
+            return error_show(1004,"部门名称已存在");
+        }
+        $pid = isset($this->post['pid']) && $this->post['pid'] !==""? trim($this->post['pid']):"";
+        if($pid===""){
+            return error_show(1002,"父级id不能为空");
+        }
+        //$spid = Db::name('company_item')->where(['id'=>$pid,'is_del'=>0])->find();
+        $spid=['depart_link'=>""];
+
+        if($pid!=0){
+            $spid = Db::name('company_item')->where(['id'=>$pid,'is_del'=>0])->find();
+            if(empty($spid)){
+                return error_show(1004,"父级数据不能为空");
+            }
+        }
+        $level = isset($this->post['level']) && $this->post['level'] !==""? trim($this->post['level']):"1";
+        $weight = isset($this->post['weight']) && $this->post['weight'] !==""? trim($this->post['weight']):"1";
+        Db::startTrans();
+        try{
+            $data =[
+                "name"=>$item_name, "pid"=>$pid, "level"=>$level, "weight"=>$weight,
+                "is_del"=>0,
+                "addtime"=>date("Y-m-d H:i:s"),
+                "updatetime"=>date("Y-m-d H:i:s"),
+
+            ];
+
+            $t= Db::name("company_item")->insert($data,true);
+            if($t>0){
+//                $orde = ["order_code"=>$repeat_name['name'],"status"=>0,"action_remark"=>'',"action_type"=>"creat"];
+//                ActionLog::logAdd($token,$orde,"company_item",0,$orde);
+                $depart_link=$spid['depart_link']."{$t}-";
+                $level =explode('-',$depart_link);
+                $level = array_filter($level);
+                $level= count($level);
+                $i=['depart_link'=>$depart_link,'level'=>$level];
+                $o=Db::name('company_item')->where(['id'=>$t])->update($i);
+                if($o){
+//                    $stn = ["order_code"=>$repeat_name['name'],"status"=>0,"action_remark"=>'',"action_type"=>"edit"];
+//                    ActionLog::logAdd($token,$stn,"company_item",0,$stn);
+                    Db::commit();
+                    return error_show(0,"添加成功");
+                }
+            }
+            Db::rollback();
+
+        }catch (\Exception $e){
+            Db::rollback();
+            return error_show(1003,$e->getMessage());
+        }
+    }
+    public function refresh(){
+        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $id = isset($this->post['id'])?intval($this->post['id']):"";
+        $items = Db::name("company_item")->where(['id'=>$id,'is_del'=>0])->find();
+        if($items==false){
+            return error_show(1003,"部门信息不存在");
+        }
+        $pid = isset($this->post['pid']) && $this->post['pid'] !==""? trim($this->post['pid']):"";
+        if($pid==""){
+            return error_show(1002,"父级id不能为空");
+        }
+        $spid=['depart_link'=>""];
+        if($pid!=0){
+            $spid = Db::name('company_item')->where(['id'=>$pid,'is_del'=>0])->find();
+            if(!empty($spid)){
+                return error_show(1004,"父级数据不能为空");
+            }
+        }
+        $weight = isset($this->post['weight']) && $this->post['weight'] !==""? trim($this->post['weight']):"1";
+        $itemname=isset($this->post['name'])? trim($this->post['name']):"";
+        if($itemname==""){
+            return error_show(1002,"部门名称不能为空");
+        }
+        $repeat_name = Db::name("company_item")->where(["is_del"=>0,"name"=>$itemname])->where('id','<>',$id)->find();
+        //echo Db::name("company_item")->getLastSql();
+        if(!empty($repeat_name)){
+            return error_show(1004,"部门名称已存在");
+        }
+        $depart_link=$spid['depart_link']."{$id}-";
+        $itemlevel =explode('-',$depart_link);
+        $itemlevel = array_filter($itemlevel);
+        $itemlevel= count($itemlevel);
+
+        $item=[
+            "id"=>$id,
+            "name"=>$itemname,
+            "updatetime"=>date("Y-m-d H:i:s"),
+            "weight"=>$weight,"pid"=>$pid,
+            'depart_link'=>$depart_link,
+            'level'=>$itemlevel
+        ];
+        $re = Db::name("company_item")->save($item);
+//        $stn = ["order_code"=>$repeat_name['name'],"status"=>0,"action_remark"=>'',"action_type"=>"edit"];
+//        ActionLog::logAdd($token,$stn,"company_item",0,$stn);
+        return $re ? app_show(0,"信息更新成功"): error_show(1003,"信息更新失败");
+    }
+    /*查询*/
+    public function query(){
+        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+
+        $dati = Db::name("company_item")->where(['pid'=>0,'is_del'=>0])->order("weight desc")->select();
+        $k=[];
+        foreach ($dati as $key=>$value){
+            // $temp=[];
+            //$temp= Db::name("company_item")->where(['pid'=>$value['id'],'is_del'=>0])->order("weight desc")->select();
+            // $value['child'] =$temp;
+            // $k[]=$value;
+            $k[]=crea($value);
+        }
+        return app_show(0,"获取成功",$k);
+    }
+
+    public function itemdel(){
+        $token = isset($this->post['token']) ? trim($this->post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $id = isset($this->post['id']) ? intval($this->post['id']):"";
+        $items = Db::name("company_item")->where(['is_del'=>0,'id'=>$id])->find();
+        if($items==false){
+            return error_show(1003,"部门信息不存在");
+        }
+        $items['is_del']=1;
+        $items['updatetime']=date("Y-m-d H:i:s");
+        $result = Db::name("company_item")->save($items);
+//        $stn = ["order_code"=>$items['name'],"status"=>0,"action_remark"=>'',"action_type"=>"delete"];
+//        ActionLog::logAdd($token,$stn,"company_item",0,$stn);
+        return $result ? app_show(0,"删除成功"): error_show(1003,"删除失败");
+    }
+}

+ 397 - 0
app/admin/controller/Note.php

@@ -0,0 +1,397 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\admin\model\NoteLog;
+use app\BaseController;
+use think\console\command\Make;
+use think\facade\Db;
+use think\App;
+
+class Note extends BaseController
+{
+public $post="";
+public function __construct(App $app)
+{
+    parent::__construct($app);
+    $this->post = $this->request->post();
+}
+public function create(){
+    $token = isset($this->post['token']) && $this->post['token'] !=="" ?trim($this->post['token']):"";
+    $title = isset($this->post['title']) && $this->post['title']!==""? trim($this->post['title']):"";
+    if($title==""){
+        return error_show(1002,"参数title不能为空");
+    }
+    $remark = isset($this->post['remark']) && $this->post['remark']!==""? trim($this->post['remark']):"";
+    if($remark==""){
+        return error_show(1002,"参数remark不能为空");
+    }
+   // $department= isset($this->post['department']) && $this->post['department']!==""? trim($this->post['department']):"";
+    $company_type= isset($this->post['company_type']) && $this->post['company_type']!==""? trim($this->post['company_type']):"";
+    if($company_type==""){
+        return error_show(1002,"参数company_type不能为空");
+    }
+    $model_id= isset($this->post['model_id']) && $this->post['model_id']!==""? $this->post['model_id']:[];
+//    if(empty($model_id)){
+//        return error_show(1002,"参数model_id不能为空");
+//    }
+    $noteNo= isset($this->post['noteNo']) && $this->post['noteNo'] !==""? $this->post['noteNo']:"";
+
+//    $talk = isset($this->post['talk']) && $this->post['talk'] !==""? trim($this->post['talk']) :"";
+//    if($talk==""){
+//        return error_show(1002,"参数talk不能为空");
+//    }
+    $bugNo= makeNo("BG");
+    $apply_id =GetUserInfo($token);
+    if(empty($apply_id)||$apply_id['code']!=0){
+        return error_show($apply_id['code'],$apply_id['message']);
+    }
+    $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+    $ri= isset($apply_id["data"]['nickname']) ?  $apply_id["data"]['nickname'] : "";
+
+    $tem=[];
+    $tem['bugNo']=$bugNo;
+    $tem['title']="";
+    $tem['level']="";
+    $tem['status']="";
+    $tem['remark']="";
+    $tem['noteNo']="";
+    //$tem['company_type']="";
+    $tem['deal_name']="";
+    $tem['type']="";
+    //array_column($in,"id");
+    $tem['model_id']="";
+
+    $level= isset($this->post['level']) && $this->post['level']!==""? intval($this->post['level']):"2";
+    $type= isset($this->post['type']) && $this->post['type']!==""? intval($this->post['type']):"2";
+    $weight= isset($this->post['weight']) && $this->post['weight']!==""? trim($this->post['weight']):"";
+    $status= isset($this->post['status']) && $this->post['status']!==""? intval($this->post['status']):"0";
+    $submit =  isset($this->post['submit']) && $this->post['submit']!==""? intval($this->post['submit']):"1";
+
+    $data=[
+        "model_id"=>!empty($model_id) ? array_pop($model_id):"0",
+        //"talk"=>$talk,
+        "bugNo"=>$bugNo,
+        "noteNo"=>$noteNo,
+        "title"=>$title,
+        "remark"=>$remark,
+        "company_type"=>$company_type,
+       // "department"=>$department,
+        "apply_name"=>$ri,
+        "apply_id"=>$rm,
+        "level"=>$level,
+        "type"=>$type,
+        "submit"=>$submit,
+        "weight"=>$weight,
+        "status"=>$status,
+        "is_del"=>0,
+        "addtime"=>date("Y-m-d H:i:s"),
+        "updatetime"=>date("Y-m-d H:i:s")
+    ];
+    $datainfo= Db::name('note')->insert($data);
+
+    if($datainfo){
+        NoteLog::log($tem,$this->post,1);
+        return error_show(0,"新建成功");
+    }else{
+        return error_show(1002,"新建失败");
+    }
+}
+public function list(){
+    $token = isset($this->post['token']) && $this->post['token'] !=="" ?trim($this->post['token']):"";
+    $page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']):"1";
+    $size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']):"10";
+    $where =[['is_del','=',0]];
+    $bugNo =isset($this->post['bugNo']) &&$this->post['bugNo'] !=="" ? trim($this->post['bugNo']):"";
+    if($bugNo!=""){
+        $where[]=['bugNo',"like","%$bugNo%"];
+    }
+    $model_id =isset($this->post['model_id']) &&$this->post['model_id'] !=="" ? trim($this->post['model_id']):"";
+    if($model_id!=""){
+        $where[]=['model_id',"=",$model_id];
+    }
+    $noteNo =isset($this->post['noteNo']) &&$this->post['noteNo'] !=="" ? trim($this->post['noteNo']):"";
+    if($noteNo!=""){
+        $where[]=['noteNo',"like","%$noteNo%"];
+    }
+    $company_type =isset($this->post['company_type']) &&$this->post['company_type'] !=="" ? trim($this->post['company_type']):"";
+    if($company_type!=""){
+        $where[]=['company_type',"=",$company_type];
+    }
+    $apply_name = isset($this->post['apply_name']) && $this->post['apply_name'] !==""? trim($this->post['apply_name']):"";
+    if($apply_name!==""){
+        $where[]=['apply_name',"like","%$apply_name%"];
+    }
+    $apply_id =GetUserInfo($token);
+    if(empty($apply_id)||$apply_id['code']!=0){
+        return error_show($apply_id['code'],$apply_id['message']);
+    }
+    $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+    $status = isset($this->post['status']) && $this->post['status'] !==""? intval($this->post['status']):"";
+    if($status!==""){
+        if($status<8){
+            $where[]=['status',"=",$status];
+        }elseif ($status==8){
+            $where[]=['status',"<=",$status];
+            $where[]=['status',"<>",5];
+        }elseif ($status===9){
+            $where[]=['apply_id',"=",$rm];
+        }elseif ($status===10){
+            $str = Db::name('deal')->where(['action_id'=>$rm,'is_del'=>0])->select()->toArray();
+            $data =array_unique(array_column($str,'bugNo')) ;
+            $where[]=['bugNo',"in",$data];
+        }elseif ($status===11){
+            $var = Db::name('deal')->where(['deal_id'=>$rm,'is_del'=>0,'status'=>0])->select()->toArray();
+            $da =array_unique(array_column($var,'bugNo')) ;
+           $where[]=['bugNo',"in",$da];
+        }
+    }
+    $start = isset($this->post['start']) && $this->post['start']!=="" ? $this->post['start']:"";
+    if($start!==""){
+        $where[]=['addtime',">=",date('Y-m-d H:i:s',strtotime($start))];
+    }
+    $end = isset($this->post['end']) && $this->post['end']!=="" ? $this->post['end']:"";
+    if($end!==""){
+        $where[]=['addtime',"<",date('Y-m-d H:i:s',strtotime($end)+24*3600)];
+    }
+    $title = isset($this->post['title']) && $this->post['title'] !==""? intval($this->post['title']):"";
+    if($title!==""){
+        $where[]=['title',"like","%$title%"];
+    }
+    $level = isset($this->post['level']) && $this->post['level'] !==""? intval($this->post['level']):"";
+    if($level!==""){
+        $where[]=['level','=',$level];
+    }
+    $type = isset($this->post['type']) && $this->post['type'] !==""? intval($this->post['type']):"";
+    if($type!==""){
+        $where[]=['type','=',$type];
+    }
+    $deal_name= isset($this->post['deal_name']) && $this->post['deal_name'] !==""? trim($this->post['deal_name']):"";
+    if ($deal_name!==""){
+        $item = Db::name('deal')->where([["deal_name","like","%$deal_name%"],["is_del","=",0],['status',"=",0]])->select()->toArray();
+        $cn =array_unique(array_column($item,'bugNo'));
+        $where[]=["bugNo","in",$cn];
+    }
+    $count = Db::name('note')->where($where)->count();
+    $total = ceil($count/$size);
+    $page = $page>$total ? $total:$page;
+    $list = Db::name('note')->where($where)->page($page,$size)->order("addtime desc")->select();
+    $data=[];
+    foreach ($list as $value){
+        $var = Db::name('depart_user')->alias('a')->join("company_item b","a.itemid = b.id","left")
+            ->where(['a.uid'=>$value['apply_id'],'a.is_del'=>0])->column('b.name,b.id');
+        $dn=[];
+        foreach ($var as $vmp){
+            $dn[]=isset($vmp['id']) && $vmp['id'] !=0 ? make($vmp['id']):[];
+        }
+        //$value['rename'] =$var;
+        $str = Db::name("deal")->where(['bugNo'=>$value['bugNo'],'status'=>0,'is_del'=>0])->find();
+        $value['deal_id']=isset($str['deal_id']) ?$str['deal_id']:"";
+        $value['deal_name']=isset($str['deal_name']) ?$str['deal_name']:"";
+        $value['can']= isset($value['model_id']) && $value['model_id'] !=0 ? made($value['model_id']):[];
+        $value['company_name']=$dn;
+        $data[]=$value;
+    }
+    return app_show(0,"获取成功",['list'=>$data,'count'=>$count]);
+}
+public function edit(){
+    $token = isset($this->post['token']) && $this->post['token'] !=="" ?trim($this->post['token']):"";
+    $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']):"";
+    if($id==""){
+        return error_show(1002,"参数id不能为空");
+    }
+    $info=Db::name('note')->where(['id'=>$id,'is_del'=>0])->find();
+    if(empty($info)){
+        return error_show(1004,"未找到数据");
+    }
+    $title = isset($this->post['title']) && $this->post['title']!==""? trim($this->post['title']):"";
+    if($title==""){
+        return error_show(1002,"参数title不能为空");
+    }
+    $model_id= isset($this->post['model_id']) && $this->post['model_id']!==""? $this->post['model_id']:[];
+//    if(empty($model_id)){
+//        return error_show(1002,"参数model_id不能为空");
+//    }
+    $remark = isset($this->post['remark']) && $this->post['remark']!==""? trim($this->post['remark']):"";
+    if($remark==""){
+        return error_show(1002,"参数remark不能为空");
+    }
+    $company_type= isset($this->post['company_type']) && $this->post['company_type']!==""? trim($this->post['company_type']):"";
+    if($company_type==""){
+        return error_show(1002,"参数company_type不能为空");
+    }
+    $level= isset($this->post['level']) && $this->post['level']!==""? intval($this->post['level']):"1";
+    if($level==""){
+        return error_show(1002,"参数level不能为空");
+    }
+    $status= isset($this->post['status']) && $this->post['status']!==""? intval($this->post['status']):$info['status'];
+    $noteNo= isset($this->post['noteNo']) && $this->post['noteNo'] !==""? $this->post['noteNo']:"";
+    $type= isset($this->post['type']) && $this->post['type']!==""? intval($this->post['type']):"0";
+    if($type===""){
+        return error_show(1002,"参数type不能为空");
+    }
+    $weight= isset($this->post['weight']) && $this->post['weight']!==""? trim($this->post['weight']):"0";
+
+    $inf=Db::name('deal')->where(['bugNo'=>$info['bugNo'],'status'=>0,"is_del"=>0])->find();
+//    $deal_name = isset($this->post['deal_name']) && $this->post['deal_name']!=="" ? trim($this->post['deal_name']):"";
+//    if($deal_name==""){
+//        return error_show(1004,"参数deal_name不能为空");
+//    }
+    $tem=[];
+    $tem['noteNo']=$info['noteNo'];
+    $tem['bugNo']=$info['bugNo'];
+    $tem['title']=$info['title'];
+    $tem['level']=$info['level'];
+    $tem['status']=$info['status'];
+    $tem['remark']=$info['remark'];
+   // $tem['company_type']=$info['company_type'];
+    $tem['deal_name']=isset($inf['deal_name']) ? $inf['deal_name']:"";
+    $tem['type']=$info['type'];
+    //array_column($in,"id");
+    $tem['model_id']=$info['model_id'];
+
+    $apply_id =GetUserInfo($token);
+    if(empty($apply_id)||$apply_id['code']!=0){
+        return error_show($apply_id['code'],$apply_id['message']);
+    }
+    $rm= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
+    $ri= isset($apply_id["data"]['nickname']) ?  $apply_id["data"]['nickname'] : "";
+    $dom = Db::name('manange')->where(['manange_id'=>$rm,'company_id'=>$company_type,'is_del'=>0])->find();
+    if ($info['status']!=$status){
+        if($dom==false){
+            return error_show(1002,"无权限修改");
+        }
+    }
+    $deal_id = isset($this->post['deal_id']) && $this->post['deal_id']!=="" ? intval($this->post['deal_id']):"";
+    $this->post['deal_name']='';
+    $datai=[];
+    if($deal_id!==""){
+        if($dom==false){
+            return error_show(1002,"无权限修改");
+        }
+        $stn = Db::name('manange')->where(['manange_id'=>$deal_id,'company_id'=>$company_type,'is_del'=>0])->find();
+        if($stn==false){
+            return error_show(1002,"处理人不存在");
+        }
+        $to= GetInfoById($token,['id'=>$deal_id]);
+        if((!empty($to) && $to['code']!=0) ||empty($to) ){
+            return error_show($to['code'],"未找到处理人信息");
+        }
+        $in = $to['data'];
+        $this->post['deal_name']=$in['nickname'];
+        if(empty($inf)||$info['status']!=$status){
+            $datai['deal_id'] = $in['id'];
+            $datai['deal_name'] = $in['nickname'];
+            $datai['action_id'] =$rm;
+            $datai['action_name'] =  $ri;
+            $datai['bugNo'] = $info['bugNo'];
+            $datai['level'] = 1;
+            $datai['type'] = 1;
+            $datai['status'] =0;
+            $datai['is_del'] = 0;
+            $datai['addtime'] = date("Y-m-d H:i:s");
+            $datai['updatetime'] = date("Y-m-d H:i:s");
+        }else{
+            $datai['action_id'] =$rm;
+            $datai['action_name'] =  $ri;
+            $datai['id']= $inf['id'];
+            $datai['deal_name'] = $in['nickname'];
+            $datai['deal_id'] = $in['id'];
+            $datai['updatetime'] = date("Y-m-d H:i:s");
+        }
+    }
+
+    Db::startTrans();
+    try{
+            $data=[
+                "id"=>$id,
+                "title"=>$title,
+                "noteNo"=>$noteNo,
+                "remark"=>$remark,
+                //"model_id"=>is_null(array_pop($model_id)) ? array_pop($model_id):"0",
+                "model_id"=>!empty($model_id) ? array_pop($model_id):"0",
+                "company_type"=>$company_type,
+//            "apply_name"=>$ri,
+//            "apply_id"=>$rm,
+                "level"=>$level,
+                "type"=>$type,
+                "weight"=>$weight,
+                "status"=>$status,
+                "is_del"=>0,
+                "updatetime"=>date("Y-m-d H:i:s")
+            ];
+            $datainfo = Db::name('note')->where($info)->save($data);
+            if($datainfo){
+                if ($info['status']!=$status && $inf!=false){
+                    $inf['action_id']=$rm;
+                    $inf['action_name']=$ri;
+                    $inf['status']=1;
+                    $inf['updatetime']=date("Y-m-d H:i:s");
+                    $dc = Db::name('deal')->where(['id'=>$inf['id'],'status'=>0,'is_del'=>0])->save($inf);
+                    if($dc==false){
+                        Db::rollback();
+                        return error_show(1002,"更新失败");
+                    }
+                }
+                if(!empty($datai)){
+                    $dai= Db::name('deal')->save($datai);
+                    if($dai==false){
+                        Db::rollback();
+                        return error_show(1002,"更新失败");
+                    }
+                }
+                NoteLog::log($tem,$this->post,2);
+            Db::commit();
+            return error_show(0,"更新成功");
+        }else{
+            Db::rollback();
+            return error_show(1002,"更新失败");
+        }
+
+    }catch (\Exception $e){
+        Db::rollback();
+        return error_show(1004,$e->getMessage());
+    }
+//    $item['deal_id']
+
+}
+public function info(){
+    $id=isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']):"";
+    if($id=="") {
+        return error_show(1002, "参数id不能为空");
+    }
+    $info = Db::name('note')->where(['id'=>$id,'is_del'=>0])->find();
+    $var = Db::name('depart_user')->alias('a')->join("company_item b","a.itemid = b.id","left")
+        ->where(['a.uid'=>$info['apply_id'],'a.is_del'=>0])->column('b.name,b.id');
+    $dn=[];
+    foreach ($var as $vmp){
+        $dn[]=isset($vmp['id']) && $vmp['id'] !=0 ? make($vmp['id']):[];
+    }
+    $item = Db::name('deal')->where(['bugNo'=>$info['bugNo'],'is_del'=>0,'status'=>0])->find();
+    $info['deal_id']=isset($item['deal_id']) ? $item['deal_id']:"";
+    $info['deal_name']=isset($item['deal_name']) ? $item['deal_name']:"";
+    $in= isset($info['model_id']) && $info['model_id'] !=0 ? made($info['model_id']):[];
+    $info['can']=$in;
+    $info['company_name']=$dn;
+    $info['model_id']=array_column($in,"id");
+    if(empty($info)){
+        return error_show(1002,"未找到数据");
+    }else{
+        return app_show(0,"获取成功",$info);
+    }
+}
+    public function del(){
+        $id = isset($this->post['id']) && $this->post['id'] !==""? intval($this->post['id']) :"";
+        if($id==""){
+            return error_show(1002,"参数id不能为空");
+        }
+        $info=Db::name('note')->where(['id'=>$id,'is_del'=>0])->find();
+        if(empty($info)){
+            return error_show(1002,"未找到数据");
+        }
+            $str['is_del']=1;
+            $str['updatetime']=date("Y-m-d H:i:s");
+            $info=Db::name('note')->where(['is_del'=>0])->save($str);
+            return $info ? app_show(0,"删除成功") :error_show(1002,"删除失败");
+        }
+}

+ 363 - 0
app/admin/controller/Role.php

@@ -0,0 +1,363 @@
+<?php
+
+
+namespace app\admin\controller;
+use app\BaseController;
+use think\App;
+use think\facade\Db;
+class Role extends BaseController
+{
+
+    public function __construct(App $app)
+    {
+        parent::__construct($app);
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+    }
+
+    /**
+     * @param status
+     * @param role_name
+     * @param level
+     * @param page
+     * @param size
+     * @return \think\response\Json
+     * @throws \think\exception\DbException
+     */
+    public function  RoleList(){
+        $post  =$this->request->post();
+
+        $condition=[];
+        isset($post['status'])&&$post['status']!=="" ? $condition[]=['a.status',"=",$post['status']]:"";
+        isset($post['role_name'])&&$post['role_name']!=="" ? $condition[]=['a.role_name',"like","%".$post['role_name']."%"]:"";
+        isset($post['item'])&&$post['item']!=="" ? $condition[]=["a.item","=",$post['item']]:"";
+        isset($post['createrId'])&&$post['createrId']!=="" ? $condition[]=["a.createrId","=",$post['createrId']]:"";
+        $roleList = Db::name("role");
+        $count =$roleList->alias("a")->where($condition)->count();
+        $page = isset($post['page'])&& $post['page']!=''? intval($post['page']) : 1;
+        $size = isset($post['size'])&& $post['size']!=''? intval($post['size']) : 10;
+        $page >=ceil($count/$size) ? $page=ceil($count/$size) :"";
+        $list=$roleList->alias("a")->leftJoin("role_action t","a.id=t.role_id")->leftJoin("company_item i","a
+        .item=i.id")->field("a.*,i.name as item_name,t.action_conllect as action,t.action_data")->where($condition)
+            ->page($page,$size)->select();
+
+        return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
+    }
+
+    /**
+     * @param role_name
+     * @param level
+     * @param action
+     * @param action_data
+     * @param role_name
+     * @return \think\response\Json
+     * @throws \think\exception\DbException
+     */
+    public function RoleAdd(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $creater= GetUserInfo($post['token']);
+        if(isset($creater['code'])&&$creater['code']==0){
+            $uid= isset($userinfo['data']['id']) ? $userinfo['data']['id']: "0";
+            $username = isset($userinfo['data']['nickname']) ? $userinfo['data']['nickname']: "";
+        }else{
+            $username = '';
+            $uid= 0;
+        }
+        $rolename = isset($post['role_name']) ? trim($post['role_name']) : "";
+        if($rolename==""){
+            return error_show(1002,"角色名称不能为空");
+        }
+        $isT=Db::name("role")->where(['role_name'=>$rolename])->find();
+        if($isT){
+            return error_show(1002,"角色名称已存在");
+        }
+        $role_code= isset($post['role_code'])&&$post['role_code']!=''?trim($post['role_code']) :"";
+//        if($role_code==""){
+//            return error_show(1002,"参数role_code 不能为空");
+//        }
+//        $isCode=Db::name("role")->where(['role_code'=>$role_code])->find();
+//        if($isCode){
+//            return error_show(1002,"角色编号已存在");
+//        }
+//        $item = isset($post['item']) ? trim($post['item']) : "";
+//        if($item==""){
+//            return error_show(1003,"参数item 不能为空");
+//        }
+//        $iteminfo = Db::name('company_item')->where('id',"=",$item)->find();
+//        if(empty($iteminfo) || $iteminfo['is_del']==1){
+//            return error_show(1003,"该部门不存在");
+//        }
+        $level = isset($post['level']) ? intval($post['level']) : 0;
+        $remark = isset($post['remark']) ? trim($post['remark']) : '';
+//        if($level==""){
+//            return error_show(1003,"参数不能为空");
+//        }
+        $action = isset($post['action'])&&is_array($post['action']) ? implode(",",$post['action']) : "";
+        if($action==""){
+            return error_show(1004,"功能权限不能为空");
+        }
+        $data = isset($post['action_data']) &&is_array($post['action_data'])?implode(",",$post['action_data']): "";
+        $private_data = isset($post['private_data']) &&is_array($post['private_data'])?implode(",",$post['private_data']): "";
+//        if($data==""){
+//            return error_show(1004,"字段权限不能为空");
+//        }
+
+        Db::startTrans();
+        try {
+            $list = [
+                "role_name"=>$rolename,
+                "role_code"=>$role_code,
+                "status"=>1,
+                'creater'=>$username,
+                'createrId'=>$uid,
+                "addtime"=>date("Y-m-d H:i:s"),
+                "updatetime"=>date("Y-m-d H:i:s"),
+                "level"=>$level,
+                "desc"=>$remark,
+                "item"=>"",
+            ];
+            $role= Db::name("role")->insert($list,true);
+//            $st = ["order_code"=>$role_code,"status"=>1,"action_remark"=>'',"action_type"=>"create"];
+//            ActionLog::logAdd($token,$st,"role",1,$st);
+            if($role>0){
+                $role_action = [
+                    "role_id"=>$role,
+                    "action_conllect"=>$action,
+                    "action_data"=>$data,
+                    "private_data"=>$private_data,
+                    "status"=>1,
+                    "addtime"=>date("Y-m-d H:i:s"),
+                    "updatetime"=>date("Y-m-d H:i:s"),
+                ];
+                $roleaction= Db::name("role_action")->insert($role_action,true);
+                if($roleaction){
+//                    $sty = ["order_code"=>$role,"status"=>1,"action_remark"=>'',"action_type"=>"create"];
+//                    ActionLog::logAdd($token,$sty,"role_action",1,$sty);
+                    Db::commit();
+                    return app_show(0,"新建成功");
+                }else{
+                    Db::rollback();
+                    return error_show(1005,"权限录入失败");
+                }
+            }else{
+                Db::rollback();
+                return error_show(1006,"角色新建失败");
+            }
+
+        }catch (\Exception $e){
+            Db::rollback();
+            return error_show(1008,$e->getMessage());
+        }
+    }
+
+    /**
+     * @param roleid
+     * @return \think\response\Json
+     * @throws \think\exception\DbException
+     */
+    public function RoleInfo(){
+        $post  =$this->request->post();
+
+        $roleid= isset($post['roleid']) ? trim($post['roleid']) : "";
+        if($roleid==""){
+            return error_show(1001,'roleid不能为空');
+        }
+        $info =  $list=Db::name("role")->alias("a")->leftJoin("role_action t","a.id=t.role_id")->field("a.*,t.action_conllect,t.action_data,t.private_data")->where("a.id","=",$roleid)->find();
+        if(!$info){
+            return error_show(1002,"未找到对应的数据");
+        }
+        $info['item_name'] ='';
+        if($info['item']!=''){
+            $iteminfo = Db::name('company_item')->where('id',"=",$info['item'])->find();
+            $info['item_name'] = isset($iteminfo['name'])? $iteminfo['name']:"";
+        }
+        $info['action'] =explode(",",$info['action_conllect']);
+        $info['action_data'] =$info['action_data']!=""?explode(",",$info['action_data']):"";
+        $info['private_data'] =$info['private_data']!=""?explode(",",$info['private_data']) :"";
+
+        return app_show(0,"获取成功",$info);
+    }
+    /**
+     * @param role_name
+     * @param level
+     * @param action
+     * @param action_data
+     * @param roleid
+     * @return \think\response\Json
+     * @throws \think\exception\DbException
+     */
+    public function RoleSave(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $roleid= isset($post['roleid']) ? intval($post['roleid']) : "";
+        if($roleid==""){
+            return error_show(1001,'roleid不能为空');
+        }
+        $info =Db::name("role")->where("id","=",$roleid)->find();
+        if(!$info){
+            return error_show(1002,"未找到对应的数据");
+        }
+        $rolename = isset($post['role_name']) ? trim($post['role_name']) : "";
+        if($rolename==""){
+            return error_show(1002,"角色名称不能为空");
+        }
+        $vers= Db::name("role")->where("id",'<>',$roleid)->where("role_name","=",$rolename)->find();
+
+        if($vers){
+            return error_show(1002,"角色名已存在");
+        }
+        $role_code= isset($post['role_code'])&&$post['role_code']!=''?trim($post['role_code']) :"";
+//        if($role_code==""){
+//            return error_show(1002,"参数role_code 不能为空");
+//        }
+//        $isCode=Db::name("role")->where(['role_code'=>$role_code])->find();
+//        if($isCode){
+//            return error_show(1002,"角色编号已存在");
+//        }
+//        $item = isset($post['item']) ? trim($post['item']) : "";
+//        if($item==""){
+//            return error_show(1003,"参数item 不能为空");
+//        }
+//        $iteminfo = Db::name('company_item')->where('id',"=",$item)->find();
+//        if($iteminfo['is_del']==1){
+//            return error_show(1003,"该部门不存在");
+//        }
+        $level = isset($post['level']) ? intval($post['level']) : 0;
+        $remark = isset($post['remark']) ? trim($post['remark']) : '';
+        $action = isset($post['action'])&&is_array($post['action']) ? implode(",",$post['action']) : "";
+        if($action==""){
+            return error_show(1004,"功能权限不能为空");
+        }
+        $data = isset($post['action_data']) &&is_array($post['action_data'])?implode(",",$post['action_data']): "";
+        $private_data = isset($post['private_data']) &&is_array($post['private_data'])?implode(",",$post['private_data']): "";
+//        if($data==""){
+//            return error_show(1004,"字段权限不能为空");
+//        }
+        Db::startTrans();
+        try {
+            $list = [
+                "role_name"=>$rolename,
+                "level"=>$level,
+                'desc'=>$remark,
+                'role_code'=>$role_code,
+                'item'=>"",
+                "updatetime"=>date("Y-m-d H:i:s"),
+                'id'=>$roleid
+            ];
+            $role= Db::name("role")->save($list);
+//            $stm = ["order_code"=>"YS","status"=>0,"action_remark"=>'',"action_type"=>"edit"];
+//            ActionLog::logAdd($token,$stm,"resign_info",0,$stm);
+            if($role){
+                $role_action = [
+                    "role_id"=>$roleid,
+                    "action_conllect"=>$action,
+                    "action_data"=>$data,
+                    "private_data"=>$private_data,
+                    "updatetime"=>date("Y-m-d H:i:s")
+                ];
+                $roleaction= Db::name("role_action")->where("role_id","=",$roleid)->update($role_action);
+                if($roleaction){
+//                    $stl = ["order_code"=>"YS","status"=>0,"action_remark"=>'',"action_type"=>"edit"];
+//                    ActionLog::logAdd($token,$stl,"role_action",0,$stl);
+                    Db::commit();
+                    return app_show(0,"更新成功");
+                }else{
+                    Db::rollback();
+                    return app_show(1005,"权限更新失败");
+                }
+            }else{
+                Db::rollback();
+                return app_show(1006,"角色更新失败");
+            }
+
+        }catch (\Exception $e){
+            Db::rollback();
+            return error_show(1008,$e->getMessage());
+        }
+    }
+
+    /**
+     * @return \think\response\Json
+     * @throws \think\exception\DbException
+     */
+    public function RoleStatus(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $roleid= isset($post['roleid']) ? intval($post['roleid']) : "";
+        if($roleid==""){
+            return error_show(1001,'roleid不能为空');
+        }
+        $status = isset($post['status']) ? intval($post['status']) : "";
+        if($status===""){
+            return error_show(1001,'status不能为空');
+        }
+        if(!in_array($status,[0,1])){
+            return error_show(1001,'status参数非法');
+        }
+        Db::startTrans();
+        try {
+            //  $re = PasRoleList::update(['status'=>$status,'update'=>date("Y-m-d H:i:s")],['id'=>$roleid]);
+            $dat=[
+                'status'=>$status,'updatetime'=>date("Y-m-d H:i:s"),  'id'=>$roleid
+            ];
+            $re = Db::name("role")->save($dat);
+            if($re){
+                $dat2=[
+                    'status'=>$status,'updatetime'=>date("Y-m-d H:i:s")
+                ];
+                $action =  Db::name("role_action")->where("role_id","=",$roleid)->update($dat2);
+                if($action){
+
+//                    $sti = ["order_code"=>$roleid,"status"=>$status,"action_remark"=>'',"action_type"=>"edit"];
+//                    ActionLog::logAdd($token,$sti,"role_action",$status,$sti);
+                    Db::commit();
+                    return app_show(0,"状态更新成功");
+                }
+            }
+            Db::rollback();
+            return error_show(1003,"状态更新失败");
+        }catch (\Exception $e){
+            Db::rollback();
+            return error_show(1002,$e->getMessage());
+        }
+    }
+
+    /**
+     * @return \think\response\Json
+     * @throws \think\exception\DbException
+     */
+    public function RoleAll(){
+        $post  =$this->request->post();
+        $list =Db::name("role")->select();
+        return app_show(0,"获取成功",$list);
+    }
+}

+ 338 - 0
app/admin/controller/User.php

@@ -0,0 +1,338 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\controller;
+
+use app\BaseController;
+use think\facade\Db;
+class User extends BaseController
+{
+    public function setRole(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return app_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return app_show($effetc['code'],$effetc['message']);
+        }
+        $uid = isset($post['id'])&&$post['id']!=='' ? intval($post['id']) :"";
+        if($uid===''){
+            return error_show(1004,"参数id 不能为空");
+        }
+        $role =isset($post['roleid']) && $post['roleid']!=="" ? intval($post['roleid']) :"";
+        if($role===''){
+            return error_show(1004,"参数roleid 不能为空");
+        }
+        $isRole = Db::name('role')->where([['id',"=",$role],['status',"=",1]])->find();
+        if(empty($isRole)){
+            return error_show(1004,"所选角色不存在");
+        }
+        $data = [
+            'uid'=>$uid,
+            'roleid'=>$role,
+            'status'=>1,
+            'addtime'=>date('Y-m-d H:i:s'),
+            'updatetime'=>date('Y-m-d H:i:s'),
+        ];
+        $insert = Db::name('user_role')->insert($data);
+//        $st = ["order_code"=>$uid,"status"=>1,"action_remark"=>'',"action_type"=>"create"];
+//        ActionLog::logAdd($token,$st,"resign_info",1,$st);
+        return $insert? app_show(0,'数据新建成功'):error_show(1004,'数据新建失败');
+    }
+
+    /**
+     * 显示资源列表
+     *
+     * @return \think\Response
+     */
+    public function list()
+    {
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return error_show(101,'token不能为空');
+        }
+        $effetc =VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return error_show($effetc['code'],$effetc['message']);
+        }
+        $data = Getlist($token,$post);
+        if(!empty($data) && $data['code']!=0){
+            return error_show($data['code'],$data['message']);
+        }
+        $list=[];
+        foreach($data['data']['list'] as $key=>$value){
+            $role = Db::name("user_role")->alias('a')->leftJoin('role b',"a.roleid = b.id")->where("a.uid","=",$value['id'])
+                ->field("roleid,role_name,a.status")->find();
+            $value['roleid'] = isset($role['roleid']) ? $role['roleid'] :"";
+            $value['role_name'] = isset($role['role_name']) ? $role['role_name'] :"";
+            $value['status'] = isset($role['status']) ? $role['status'] :"0";
+            $depart = Db::name("depart_user")->where([["uid","=",$value['id']],["is_del","=",0]])->column("itemid");
+            $value['depart']="";
+            if(!empty($depart)){
+                //  $deparname = Db::name("company_item")->where(["id"=>$depart,"is_del"=>0])->column("name");
+                $deparname = Db::name("company_item")->where(["id"=>$depart,"is_del"=>0])->column("id,name,depart_link");
+                $value['depart_code'] = [];
+                if(!empty($deparname)){
+                    foreach ($deparname as $item) {
+                        $value['depart_code'][] = array_filter(explode("-",$item['depart_link'])) ;
+                        $value['depart_info'][] = Db::name("company_item")->where(["id"=>array_filter(explode("-",
+                            $item['depart_link'])),"is_del"=>0])->column("name");
+                    }
+                }
+                $value['depart'] = $deparname;
+            }
+            $list[]=$value;
+        }
+        $data['data']['list'] = $list;
+        return app_show($data['code'],$data['message'],$data['data']);
+    }
+
+    /**
+     * @param token
+     * @return \think\response\Json
+     * @throws \think\exception\DbException
+     */
+    public function userInfo(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return app_show(101,'token不能为空');
+        }
+
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return app_show($effetc['code'],$effetc['message']);
+        }
+        $userinfo=GetUserInfo($token);
+        if(empty($userinfo)||$userinfo['code']!=0){
+            return app_show(1002,"员工信息不存在");
+        }
+        $data = $userinfo['data'];
+        $role = Db::name("user_role")->alias('a')->leftJoin('role b',"a.roleid = b.id")->where("a.uid","=",$data['id'])
+            ->field("roleid,role_name,a.status")->find();
+        $data['role_name']=isset($role['role_name']) ? $role['role_name'] :"";
+        $data['roleid']=isset($role['roleid']) ? $role['roleid'] :"";
+        $data['status'] = isset($role['status']) ? $role['status'] :"0";
+        $depart = Db::name("depart_user")->where([["uid","=",$data['id']],["is_del","=",0]])->column("itemid");
+        $data['depart']="";
+        if(!empty($depart)){
+            $deparname = Db::name("company_item")->where(["id"=>$depart,"is_del"=>0])->field("id,name,depart_link")->select();
+            $value['depart_code'] = [];
+            if(!empty($deparname)){
+                foreach ($deparname as $item) {
+                    $value['depart_code'][] = array_filter(explode("-",$item['depart_link'])) ;
+                }
+            }
+            $data['depart'] = $deparname;
+        }
+        return app_show(0,"获取成功",$data);
+    }
+    public  function  userAll(){
+        $post  =$this->request->post();
+        $token = isset($post['token']) ? trim($post['token']) : "";
+        if($token==""){
+            return app_show(101,'token不能为空');
+        }
+        $effetc = VerifyTokens($token);
+        if(!empty($effetc) && $effetc['code']!=0){
+            return app_show($effetc['code'],$effetc['message']);
+        }
+        $userinfo=GetAccountall($token,$post);
+        if(empty($userinfo)||$userinfo['code']!=0){
+            return app_show(1002,"员工信息不存在");
+        }
+        $data = $userinfo['data'];
+        $list=[];
+        foreach ($data as $value){
+            $role = Db::name("user_role")->alias('a')->leftJoin('role b',"a.roleid = b.id")->where("a.uid","=",$value['id'])
+                ->field("roleid,role_name,a.status")->find();
+            $value['roleid'] = isset($role['roleid']) ? $role['roleid'] :"";
+            $value['role_name'] = isset($role['role_name']) ? $role['role_name'] :"";
+            $value['status'] = isset($role['status']) ? $role['status'] :"0";
+            $depart = Db::name("depart_user")->where([["uid","=",$value['id']],["is_del","=",0]])->column("itemid");
+            $value['depart']="";
+            if(!empty($depart)){
+                $deparname = Db::name("company_item")->where(["id"=>$depart,"is_del"=>0])->field("id,name,depart_link")
+                    ->select()->toArray();
+
+                array_walk($deparname,function (&$v){
+                    $v = array_filter(explode("-",$v['depart_link'])) ;
+                });
+                $value['depart'] = $deparname;
+            }
+            $list[]=$value;
+        }
+        return app_show(0,"获取成功",$list);
+    }
+
+    /**
+     * 保存新建的资源
+     *
+     * @param  \think\Request  $request
+     * @return \think\Response
+     */
+    public function UserSave()
+    {
+        $post=$this->request->post();
+        $toke= isset($post['token'])? trim($post['token']):"";
+        if ($toke==""){
+            return app_show(100,"token不能为空");
+        }
+        $verify = VerifyTokens($toke);
+        if ($verify['code']!=0){
+            return app_show($verify['code'],$verify['message']);
+        }
+        $userid = isset($post['id'])&&$post['id']!==""?intval($post['id']):"";
+        if($userid==""){
+            return error_show(1004,"参数id 不能为空");
+        }
+
+        $nickname= isset($post['nickname'])? trim($post['nickname']):"";
+        if ($nickname==""){
+            return app_show(1001,"昵称不能为空");
+        }
+        $mobile= isset($post['mobile'])? trim($post['mobile']):"";
+        if ($mobile==""){
+            return app_show(1002,"手机号不能为空");
+        }
+        if (checkMobile($mobile)==false){
+            return app_show(1002,"手机号格式不正确");
+        }
+        $email= isset($post['email'])? trim($post['email']):"";
+        $role =isset($post['role'])? intval($post['role']):0;
+        if($role!=0){
+            $roleinfo =Db::name("role")->where("id","=",$role)->find();
+            if(empty($roleinfo)){
+                return error_show(1002,"角色不存在");
+            }
+            if($roleinfo['status']==0){
+                return error_show(1002,"角色已禁用");
+            }
+        }
+        $status = isset($post['status'])&&$post['status']!=""?intval($post['status']):"0";
+        $itemid = isset($post['itemid'])&&$post['itemid']!=="" ?$post['itemid'] :"";
+        $item_arr = [];
+        if($itemid!==""){
+            foreach ($itemid as $value){
+                $item_arr[]=end($value);
+            }
+            $iteminfo = Db::name("company_item")->where(["id"=>$item_arr,'is_del'=>0])->select()->toArray();
+            if(empty($iteminfo)){
+                return error_show(1002,"未找到部门信息");
+            }
+        }
+
+        Db::startTrans();
+        try{
+
+            $userrole = Db::name("user_role")->where(["uid"=>$userid,"is_del"=>0])->find();
+            if(empty($userrole)){
+                $roledata =[
+                    "uid"=>$userid,
+                    "roleid"=>$role,
+                    "status"=>$status,
+                    "addtime"=>date("Y-m-d H:i:s"),
+                    "updatetime"=>date("Y-m-d H:i:s")
+                ];
+                $up= Db::name("user_role")->insert($roledata);
+            }else{
+                $userrole['roleid'] = $role;
+                $userrole['status'] = $status;
+                $userrole['updatetime'] = date("Y-m-d H:i:s");
+                $up=Db::name("user_role")->save($userrole);
+            }
+            if($up){
+                $data=[
+                    "id"=>$userid,
+                    "nickname"=>$nickname,
+                    "mobile"=>$mobile,
+                    "email"=>$email
+                ];
+                $save =resetinfo($toke,$data);
+                if(!empty($save) && $save['code']!=0){
+                    Db::rollback();
+                    return error_show($save['code'],$save['message']);
+                }
+                Db::name("depart_user")->where(["uid"=>$userid])->save(['is_del'=>1]);
+                if(isset($item_arr)&&!empty($item_arr)){
+                    foreach ($item_arr as $v){
+                        $depin =[
+                            "uid"=>$userid,
+                            "nickname"=>$nickname,
+                            "itemid"=>$v,
+                            "is_del"=>0,
+                            "updatetime"=>date("Y-m-d H:i:s")
+                        ];
+                        $ist =  Db::name("depart_user")->where(["uid"=>$userid,"itemid"=>$v])->find();
+                        if($ist){
+                            $up = Db::name("depart_user")->where(["uid"=>$userid,"itemid"=>$v])->save($depin);
+                        }else{
+                            $depin['addtime']=date("Y-m-d H:i:s");
+                            $up = Db::name("depart_user")->insert($depin);
+                        }
+                        if($up==false){
+                            Db::rollback();
+                            return error_show(1005,'用户部门更新失败');
+                        }
+                    }
+                }
+                Db::commit();
+                return app_show(0,"更新成功");
+            }else{
+                Db::rollback();
+                return error_show(1005,'角色更新失败');
+            }
+
+        }catch(\Exception $e){
+            Db::rollback();
+            return app_show(1002,$e->getMessage());
+        }
+    }
+
+    public function UserStatus()
+    {
+        $post=$this->request->post();
+        $toke= isset($post['token'])? trim($post['token']):"";
+        if ($toke==""){
+            return app_show(100,"token不能为空");
+        }
+        $verify = VerifyTokens($toke);
+        if ($verify['code']!=0){
+            return app_show($verify['code'],$verify['message']);
+        }
+        $userid = isset($post['id'])&&$post['id']!==""?intval($post['id']):"";
+        if($userid==""){
+            return error_show(1004,"参数userid 不能为空");
+        }
+        $status = isset($post['status'])&&$post['status']!=""?intval($post['status']):"";
+
+        if($status===""){
+            return error_show(1004,"参数status 不能为空");
+        }
+        if(!in_array($status,[0,1])){
+            return error_show(1004,"参数status无效");
+        }
+        $message = $status==1?"启用":"禁用";
+      //  $set = resetstatus($toke,["id"=>$userid,"status"=>$status]);
+        $item = Db::name('user_role')->where(['uid'=>$userid])->find();
+        if($item==false){
+            $item=[
+                "uid"=>$userid,
+                "roleid"=>0,
+                "is_del"=>0,
+                "addtime"=>date("Y-m-d H:i:s")
+            ];
+        }
+        $item['status']=$status;
+        $item['updatetime'] = date("Y-m-d H:i:s");
+        $var = Db::name('user_role')->save($item);
+        if($var==false){
+            return error_show(1005,"{$message}失败");
+        }else{
+            return app_show(0,"{$message}成功");
+        }
+    }
+}

+ 85 - 0
app/admin/controller/index.php

@@ -0,0 +1,85 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\controller;
+
+use think\Request;
+
+class index
+{
+    /**
+     * 显示资源列表
+     *
+     * @return \think\Response
+     */
+    public function index()
+    {
+        //
+    }
+
+    /**
+     * 显示创建资源表单页.
+     *
+     * @return \think\Response
+     */
+    public function create()
+    {
+        //
+    }
+
+    /**
+     * 保存新建的资源
+     *
+     * @param  \think\Request  $request
+     * @return \think\Response
+     */
+    public function save(Request $request)
+    {
+        //
+    }
+
+    /**
+     * 显示指定的资源
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function read($id)
+    {
+        //
+    }
+
+    /**
+     * 显示编辑资源表单页.
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function edit($id)
+    {
+        //
+    }
+
+    /**
+     * 保存更新的资源
+     *
+     * @param  \think\Request  $request
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function update(Request $request, $id)
+    {
+        //
+    }
+
+    /**
+     * 删除指定资源
+     *
+     * @param  int  $id
+     * @return \think\Response
+     */
+    public function delete($id)
+    {
+        //
+    }
+}

+ 45 - 0
app/admin/model/NoteLog.php

@@ -0,0 +1,45 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\model;
+
+use think\Model;
+
+/**
+ * @mixin \think\Model
+ */
+class NoteLog extends Model
+{
+    public static function log($tem,$post,$type){
+        $token=$post['token'];
+        unset($post['token']);
+        $in=$tem['bugNo'];
+        unset($tem['bugNo']);
+        $post['model_id'] = isset($post['model_id']) ? array_pop($post['model_id']):"";
+        $item = array_diff_assoc($tem,$post);
+
+        $user = GetUserInfo($token);
+        $uid = isset($user['data']['id']) ? $user['data']['id'] :0;
+        $name = isset($user['data']['nickname']) ? $user['data']['nickname'] :'';
+        if(!empty($item)){
+            $data=[];
+            foreach ($item as $key=>$value){
+               if(isset($post[$key])==false){
+                   continue;
+               }
+                $datai=[];
+                $datai['action_uid']=$uid;
+                $datai['action_name']=$name;
+                $datai['type']=$type;
+//                $datai['action_type']=$action_type;
+                $datai['handle_name']=$key;
+                $datai['action_item']=$value;
+                $datai['action_after']=isset($post[$key]) ? $post[$key]:"";
+                $datai['bugNo']=$in;
+                $datai['addtime']=date("Y-m-d H:i:s");
+                $data[]=$datai;
+            }
+             self::insertAll($data);
+        }
+    }
+}

+ 75 - 0
app/admin/route/app.php

@@ -0,0 +1,75 @@
+<?php
+use think\facade\Route;
+Route::rule('menu', 'admin/Menu/list');
+Route::rule('menusave', 'admin/Menu/MenuEdit');
+Route::rule('menudel', 'admin/Menu/MenuDel');
+Route::rule('menustatus', 'admin/Menu/MenuStatus');
+Route::rule("menulist","admin/Menu/MenuAllList");
+
+Route::rule('userlist', 'admin/User/list');
+Route::rule('userinfo', 'admin/User/userInfo');
+Route::rule('userall', 'admin/User/userAll');
+Route::rule("userstatus","admin/User/UserStatus");
+Route::rule("usersave","admin/User/UserSave");
+Route::rule("usersetrole","admin/User/setRole");
+
+Route::rule('rolelist', 'admin/Role/RoleList');
+Route::rule('roleall', 'admin/Role/RoleAll');
+Route::rule('roleinfo', 'admin/Role/RoleInfo');
+Route::rule('roleadd', 'admin/Role/RoleAdd');
+Route::rule('rolesave', 'admin/Role/RoleSave');
+Route::rule('rolestatus', 'admin/Role/RoleStatus');
+
+Route::rule('ulist','admin/Newfill/list');
+Route::rule('add','admin/Newfill/add');
+Route::rule('refresh',"admin/Newfill/refresh");
+Route::rule('query','admin/Newfill/query');
+Route::rule('itemdel','admin/Newfill/itemdel');
+Route::rule('stat','admin/Newfill/stat');
+Route::rule('userp','admin/Newfill/userp');
+
+Route::rule('clist','admin/Departuser/list');
+Route::rule('attend','admin/Departuser/attend');
+Route::rule('useredit','admin/Departuser/useredit');
+Route::rule('ifound','admin/Departuser/found');
+Route::rule('iuserdel','admin/Departuser/userdel');
+
+Route::rule("uploadimg","admin/Cloud/upload");
+Route::rule("cloudcreate","admin/Cloud/create");
+Route::rule("cloudlist","admin/Cloud/list");
+Route::rule("cloudedit","admin/Cloud/edit");
+Route::rule("clouddel","admin/Cloud/del");
+
+Route::rule("notecreate","admin/Note/create");
+Route::rule("noteedit","admin/Note/edit");
+Route::rule("notelist","admin/Note/list");
+Route::rule("noteinfo","admin/Note/info");
+Route::rule("notedel","admin/Note/del");
+
+
+Route::rule("modelcreate","admin/Model/create");
+Route::rule("modellist","admin/Model/list");
+Route::rule("modelcreate","admin/Model/create");
+Route::rule("modeledit","admin/Model/edit");
+Route::rule("modelinfo","admin/Model/info");
+Route::rule("modeldel","admin/Model/del");
+
+Route::rule("dealcreate","admin/Deal/create");
+//Route::rule("dealselect","admin/Deal/select");
+Route::rule("deallist","admin/Deal/list");
+Route::rule("dealstatus","admin/Deal/status");
+
+Route::rule("manangelist","admin/Manange/list");
+Route::rule("manangecreate","admin/Manange/create");
+Route::rule("manangedelect","admin/Manange/del");
+
+Route::rule('menuaction', 'admin/Action/ActionList');
+Route::rule('menuactionsave', 'admin/Action/ActionSave');
+Route::rule('menuactionstatus', 'admin/Action/ActionStatus');
+Route::rule('menuactionadd', 'admin/Action/ActionAdd');
+Route::rule("menuactionlist","admin/Action/index");
+Route::rule("menuactiondel","admin/Menu/MenuActionDel");
+
+Route::rule("dealselect","admin/Deal/MenuAllList");
+Route::rule("dealadd","admin/Deal/add");
+Route::rule("manangeloglist","admin/Manange/loglist");

+ 256 - 0
app/common.php

@@ -0,0 +1,256 @@
+<?php
+use think\facade\Config;
+use think\facade\Db;
+use think\facade\Filesystem;
+// 应用公共文件
+function error_show($code=0,$message=""){
+    $result = ['code'=>$code,"message"=>$message];
+    echo json_encode($result,JSON_UNESCAPED_UNICODE);
+    die();
+}
+// 应用公共文件
+function app_show($code=0,$message="",$data=[]){
+    $result = ['code'=>$code,"message"=>$message,"data"=>$data];
+    echo json_encode($result,JSON_UNESCAPED_UNICODE);
+    die();
+}
+
+function makeNo($str){
+
+    $date=date("mdHis");
+    $year = date("Y")-2000;
+    $msec=randomkeys(4);
+    return $str.$msec.$year.$date;
+}
+function randomkeys($length) {
+    $returnStr='';
+    $pattern = '1234567890abcdefghijklmnopqrstuvwxyz';//ABCDEFGHIJKLOMNOPQRSTUVWXYZ
+
+    for($i = 0; $i < $length; $i ++) {
+        $returnStr .= $pattern[mt_rand ( 0, strlen($pattern)-1 )]; //生成php随机数
+    }
+    return $returnStr;
+}
+//参数1:访问的URL,参数2:post数据(不填则为GET),参数3:提交的$cookies,参数4:是否返回$cookies
+function curl_request($url,$post=''){
+    $curl = curl_init();
+    curl_setopt($curl, CURLOPT_URL, $url);
+    curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)');
+    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
+    curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
+    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
+    if($post) {
+        curl_setopt($curl, CURLOPT_POST, 1);
+        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
+    }
+    curl_setopt($curl, CURLOPT_TIMEOUT, 10);
+    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+    $data = curl_exec($curl);
+    if (curl_errno($curl)) {
+        return curl_error($curl);
+    }
+    curl_close($curl);
+    return $data;
+
+}
+/**
+ * @param $token
+ * @return array
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
+ * @throws \think\exception\DbException
+ */
+function VerifyTokens($token){
+    $host = Config::get("app");
+    $url = $host["api_host"]."/Api/verify_token";
+    $data=[
+        "token"=>$token
+    ];
+    $response=curl_request($url,$data);
+
+    return json_decode($response,true);
+}
+/**
+ * @param $token
+ * @param $condition
+ * @return mixed
+ */
+function GetUserlist($token,$condition){
+    $host = Config::get("app");
+
+    $url = $host["api_host"]."/Api/getuserlist";
+    $condition['token']=$token;
+    $response=curl_request($url,$condition);
+
+    return json_decode($response,true);
+}
+
+/**
+ * @param $token
+ * @param $condition
+ * @return mixed
+ */
+function GetAccountall($token, $condition){
+    $host = Config::get("app");
+
+    $url = $host["api_host"]."/Api/userall";
+    $condition['token']=$token;
+    $response=curl_request($url,$condition);
+
+    return json_decode($response,true);
+}
+
+function GetList($token,$condition){
+    $host = Config::get("app");
+
+    $url = $host["api_host"]."/Api/userlist";
+    $condition['token']=$token;
+    $response=curl_request($url,$condition);
+
+    return json_decode($response,true);
+}
+
+function GetUserInfo($token){
+    $host = Config::get("app");
+    $url = $host["api_host"]."/Api/userinfo";
+    $data=[
+        "token"=>$token
+    ];
+    $response=curl_request($url,$data);
+
+    return json_decode($response,true);
+}
+
+/**手机号验证
+ * @param $mobile
+ * @return bool
+ */
+function checkMobile($mobile){
+    if (!is_numeric($mobile)) {
+        return false;
+    }
+    return preg_match('#^1[3,4,5,6,7,8,9]{1}[\d]{9}$#', $mobile) ? true : false;
+}
+
+/**
+ * @param $token
+ * @param $condition
+ * @return mixed
+ */
+function resetinfo($token,$condition){
+    $host = Config::get("app");
+
+    $url = $host["api_host"]."/Api/usersave";
+    $condition['token']=$token;
+    $response=curl_request($url,$condition);
+
+    return json_decode($response,true);
+}
+
+/**
+ * @param $token
+ * @param $condition
+ * @return mixed
+ */
+function resetstatus($token,$condition){
+    $host = Config::get("app");
+
+    $url = $host["api_host"]."/Api/userstatus";
+    $condition['token']=$token;
+    $response=curl_request($url,$condition);
+
+    return json_decode($response,true);
+}
+
+function crea($data,$vio=0)
+{
+    $db = Db::name("company_item")->where(['pid'=>$data['id'],'is_del'=>0])->select()->toArray();
+    if($vio==1){
+        $d = Db::name("depart_user")->where(['itemid'=>$data['id'],'is_del'=>0])->select()->toArray();
+        if(empty($d)){
+            $data['item']=[];
+        }else{
+            $data['item']=$d;
+        }
+    }
+
+    if(empty($db)){
+        $data['child']=[];
+        return $data;
+    }
+    //var_dump($db);
+    foreach ($db as $p){
+        $data['child'][]=crea($p,$vio);
+    }
+    return $data;
+}
+
+/**
+ * @param $files
+ * @return array
+ */
+function UploadImg($files)
+{
+    $savename = [];
+    $files = !is_array($files) ? [$files] : $files;
+    try {
+        //验证
+        validate(['imgFile' => ['fileSize' => 10240000, 'fileExt' => 'jpg,jpeg,png,bmp,gif', 'fileMime' => 'image/jpeg,image/png,image/gif']])->check(['imgFile' => $files]);
+
+        foreach ($files as $file) {
+            $url = Filesystem::disk('public')->putFile('topic/' . date("Ymd"), $file, function () use ($file) {
+                return str_replace('.' . $file->getOriginalExtension(), '', $file->getOriginalName() . "_" . date('YmdHis'));
+            });
+            $name = str_replace('.' . $file->getOriginalExtension(), '', $file->getOriginalName());
+            $temp = ["url" => $url, "name" => $name];
+            $savename[] = $temp;
+        }
+
+        return $savename;
+    } catch (\think\exception\ValidateException $e) {
+
+        return $e->getMessage();
+    }
+}
+
+function made($var,$data=[]){
+    $str = Db::name('model')->where(['id'=>$var])->find();
+    $vmn =[];
+    $vmn['id'] =$str['id'];
+    $vmn['rename'] =$str['name'];
+   array_unshift($data,$vmn);
+    if($str['pid']==0){
+        return $data;
+    }else{
+        return made($str['pid'],$data);
+    }
+}
+
+/**
+ * @param $token
+ * @param $condition ['id'=>1]
+ * @return mixed
+ */
+function GetInfoById($token,$condition){
+    $host = Config::get("app");
+    $url = $host["api_host"]."/Api/userinfobyid";
+    $condition['token']=$token;
+    $response=curl_request($url,$condition);
+    return json_decode($response,true);
+}
+
+function make($var,$data=[]){
+    $str = Db::name('company_item')->where(['id'=>$var])->find();
+    $vmn =[];
+    $vmn['id'] =$str['id'];
+    $vmn['name'] =$str['name'];
+    array_unshift($data,$vmn);
+    // $var['id']=made();
+    if($str['pid']==0){
+        // krsort($data);
+        return $data;
+    }else{
+        return make($str['pid'],$data);
+    }
+}

+ 17 - 0
app/event.php

@@ -0,0 +1,17 @@
+<?php
+// 事件定义文件
+return [
+    'bind'      => [
+    ],
+
+    'listen'    => [
+        'AppInit'  => [],
+        'HttpRun'  => [],
+        'HttpEnd'  => [],
+        'LogLevel' => [],
+        'LogWrite' => [],
+    ],
+
+    'subscribe' => [
+    ],
+];

+ 10 - 0
app/middleware.php

@@ -0,0 +1,10 @@
+<?php
+// 全局中间件定义文件
+return [
+    // 全局请求缓存
+    // \think\middleware\CheckRequestCache::class,
+    // 多语言加载
+    // \think\middleware\LoadLangPack::class,
+    // Session初始化
+    // \think\middleware\SessionInit::class
+];

+ 9 - 0
app/provider.php

@@ -0,0 +1,9 @@
+<?php
+use app\ExceptionHandle;
+use app\Request;
+
+// 容器Provider定义文件
+return [
+    'think\Request'          => Request::class,
+    'think\exception\Handle' => ExceptionHandle::class,
+];

+ 9 - 0
app/service.php

@@ -0,0 +1,9 @@
+<?php
+
+use app\AppService;
+
+// 系统服务定义文件
+// 服务在完成全局初始化之后执行
+return [
+    AppService::class,
+];

+ 49 - 0
composer.json

@@ -0,0 +1,49 @@
+{
+    "name": "topthink/think",
+    "description": "the new thinkphp framework",
+    "type": "project",
+    "keywords": [
+        "framework",
+        "thinkphp",
+        "ORM"
+    ],
+    "homepage": "http://thinkphp.cn/",
+    "license": "Apache-2.0",
+    "authors": [
+        {
+            "name": "liu21st",
+            "email": "liu21st@gmail.com"
+        },
+        {
+            "name": "yunwuxin",
+            "email": "448901948@qq.com"
+        }        
+    ],
+    "require": {
+        "php": ">=7.1.0",
+        "topthink/framework": "^6.0.0",
+        "topthink/think-orm": "^2.0",
+        "topthink/think-multi-app": "^1.0"
+    },
+    "require-dev": {
+        "symfony/var-dumper": "^4.2",
+        "topthink/think-trace":"^1.0"
+    },
+    "autoload": {
+        "psr-4": {
+            "app\\": "app"
+        },
+        "psr-0": {
+            "": "extend/"
+        }
+    },
+    "config": {
+        "preferred-install": "dist"
+    },
+    "scripts": {
+        "post-autoload-dump": [
+            "@php think service:discover",
+            "@php think vendor:publish"
+        ]
+    }
+}

+ 1011 - 0
composer.lock

@@ -0,0 +1,1011 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "9ef3f6f1993fcd90da3b2fda07e08183",
+    "packages": [
+        {
+            "name": "league/flysystem",
+            "version": "1.1.8",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/thephpleague/flysystem.git",
+                "reference": "c995bb0c23c58c9813d081f9523c9b7bb496698e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/c995bb0c23c58c9813d081f9523c9b7bb496698e",
+                "reference": "c995bb0c23c58c9813d081f9523c9b7bb496698e",
+                "shasum": ""
+            },
+            "require": {
+                "ext-fileinfo": "*",
+                "league/mime-type-detection": "^1.3",
+                "php": "^7.2.5 || ^8.0"
+            },
+            "conflict": {
+                "league/flysystem-sftp": "<1.0.6"
+            },
+            "require-dev": {
+                "phpspec/prophecy": "^1.11.1",
+                "phpunit/phpunit": "^8.5.8"
+            },
+            "suggest": {
+                "ext-ftp": "Allows you to use FTP server storage",
+                "ext-openssl": "Allows you to use FTPS server storage",
+                "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
+                "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
+                "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
+                "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
+                "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
+                "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
+                "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
+                "league/flysystem-webdav": "Allows you to use WebDAV storage",
+                "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
+                "spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
+                "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "League\\Flysystem\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Frank de Jonge",
+                    "email": "info@frenky.net"
+                }
+            ],
+            "description": "Filesystem abstraction: Many filesystems, one API.",
+            "keywords": [
+                "Cloud Files",
+                "WebDAV",
+                "abstraction",
+                "aws",
+                "cloud",
+                "copy.com",
+                "dropbox",
+                "file systems",
+                "files",
+                "filesystem",
+                "filesystems",
+                "ftp",
+                "rackspace",
+                "remote",
+                "s3",
+                "sftp",
+                "storage"
+            ],
+            "support": {
+                "issues": "https://github.com/thephpleague/flysystem/issues",
+                "source": "https://github.com/thephpleague/flysystem/tree/1.1.8"
+            },
+            "funding": [
+                {
+                    "url": "https://offset.earth/frankdejonge",
+                    "type": "other"
+                }
+            ],
+            "time": "2021-11-28T21:50:23+00:00"
+        },
+        {
+            "name": "league/flysystem-cached-adapter",
+            "version": "1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/thephpleague/flysystem-cached-adapter.git",
+                "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff",
+                "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff",
+                "shasum": ""
+            },
+            "require": {
+                "league/flysystem": "~1.0",
+                "psr/cache": "^1.0.0"
+            },
+            "require-dev": {
+                "mockery/mockery": "~0.9",
+                "phpspec/phpspec": "^3.4",
+                "phpunit/phpunit": "^5.7",
+                "predis/predis": "~1.0",
+                "tedivm/stash": "~0.12"
+            },
+            "suggest": {
+                "ext-phpredis": "Pure C implemented extension for PHP"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "League\\Flysystem\\Cached\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "frankdejonge",
+                    "email": "info@frenky.net"
+                }
+            ],
+            "description": "An adapter decorator to enable meta-data caching.",
+            "support": {
+                "issues": "https://github.com/thephpleague/flysystem-cached-adapter/issues",
+                "source": "https://github.com/thephpleague/flysystem-cached-adapter/tree/master"
+            },
+            "time": "2020-07-25T15:56:04+00:00"
+        },
+        {
+            "name": "league/mime-type-detection",
+            "version": "1.9.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/thephpleague/mime-type-detection.git",
+                "reference": "aa70e813a6ad3d1558fc927863d47309b4c23e69"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/aa70e813a6ad3d1558fc927863d47309b4c23e69",
+                "reference": "aa70e813a6ad3d1558fc927863d47309b4c23e69",
+                "shasum": ""
+            },
+            "require": {
+                "ext-fileinfo": "*",
+                "php": "^7.2 || ^8.0"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "^3.2",
+                "phpstan/phpstan": "^0.12.68",
+                "phpunit/phpunit": "^8.5.8 || ^9.3"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "League\\MimeTypeDetection\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Frank de Jonge",
+                    "email": "info@frankdejonge.nl"
+                }
+            ],
+            "description": "Mime-type detection for Flysystem",
+            "support": {
+                "issues": "https://github.com/thephpleague/mime-type-detection/issues",
+                "source": "https://github.com/thephpleague/mime-type-detection/tree/1.9.0"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/frankdejonge",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/league/flysystem",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-11-21T11:48:40+00:00"
+        },
+        {
+            "name": "psr/cache",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/cache.git",
+                "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
+                "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Cache\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for caching libraries",
+            "keywords": [
+                "cache",
+                "psr",
+                "psr-6"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/cache/tree/master"
+            },
+            "time": "2016-08-06T20:24:11+00:00"
+        },
+        {
+            "name": "psr/container",
+            "version": "1.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/container.git",
+                "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
+                "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Container\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "https://www.php-fig.org/"
+                }
+            ],
+            "description": "Common Container Interface (PHP FIG PSR-11)",
+            "homepage": "https://github.com/php-fig/container",
+            "keywords": [
+                "PSR-11",
+                "container",
+                "container-interface",
+                "container-interop",
+                "psr"
+            ],
+            "support": {
+                "issues": "https://github.com/php-fig/container/issues",
+                "source": "https://github.com/php-fig/container/tree/1.1.1"
+            },
+            "time": "2021-03-05T17:36:06+00:00"
+        },
+        {
+            "name": "psr/log",
+            "version": "1.1.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/log.git",
+                "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
+                "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Log\\": "Psr/Log/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "https://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for logging libraries",
+            "homepage": "https://github.com/php-fig/log",
+            "keywords": [
+                "log",
+                "psr",
+                "psr-3"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/log/tree/1.1.4"
+            },
+            "time": "2021-05-03T11:20:27+00:00"
+        },
+        {
+            "name": "psr/simple-cache",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/simple-cache.git",
+                "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+                "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\SimpleCache\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interfaces for simple caching",
+            "keywords": [
+                "cache",
+                "caching",
+                "psr",
+                "psr-16",
+                "simple-cache"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/simple-cache/tree/master"
+            },
+            "time": "2017-10-23T01:57:42+00:00"
+        },
+        {
+            "name": "topthink/framework",
+            "version": "v6.0.9",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/top-think/framework.git",
+                "reference": "0b5fb453f0e533de3af3a1ab6a202510b61be617"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/top-think/framework/zipball/0b5fb453f0e533de3af3a1ab6a202510b61be617",
+                "reference": "0b5fb453f0e533de3af3a1ab6a202510b61be617",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "ext-mbstring": "*",
+                "league/flysystem": "^1.1.4",
+                "league/flysystem-cached-adapter": "^1.0",
+                "php": ">=7.2.5",
+                "psr/container": "~1.0",
+                "psr/log": "~1.0",
+                "psr/simple-cache": "^1.0",
+                "topthink/think-helper": "^3.1.1",
+                "topthink/think-orm": "^2.0"
+            },
+            "require-dev": {
+                "mikey179/vfsstream": "^1.6",
+                "mockery/mockery": "^1.2",
+                "phpunit/phpunit": "^7.0"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [],
+                "psr-4": {
+                    "think\\": "src/think/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "liu21st",
+                    "email": "liu21st@gmail.com"
+                },
+                {
+                    "name": "yunwuxin",
+                    "email": "448901948@qq.com"
+                }
+            ],
+            "description": "The ThinkPHP Framework.",
+            "homepage": "http://thinkphp.cn/",
+            "keywords": [
+                "framework",
+                "orm",
+                "thinkphp"
+            ],
+            "support": {
+                "issues": "https://github.com/top-think/framework/issues",
+                "source": "https://github.com/top-think/framework/tree/v6.0.9"
+            },
+            "time": "2021-07-22T03:24:49+00:00"
+        },
+        {
+            "name": "topthink/think-helper",
+            "version": "v3.1.5",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/top-think/think-helper.git",
+                "reference": "f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/top-think/think-helper/zipball/f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905",
+                "reference": "f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "think\\": "src"
+                },
+                "files": [
+                    "src/helper.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "yunwuxin",
+                    "email": "448901948@qq.com"
+                }
+            ],
+            "description": "The ThinkPHP6 Helper Package",
+            "support": {
+                "issues": "https://github.com/top-think/think-helper/issues",
+                "source": "https://github.com/top-think/think-helper/tree/v3.1.5"
+            },
+            "time": "2021-06-21T06:17:31+00:00"
+        },
+        {
+            "name": "topthink/think-multi-app",
+            "version": "v1.0.14",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/top-think/think-multi-app.git",
+                "reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/top-think/think-multi-app/zipball/ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3",
+                "reference": "ccaad7c2d33f42cb1cc2a78d6610aaec02cea4c3",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1.0",
+                "topthink/framework": "^6.0.0"
+            },
+            "type": "library",
+            "extra": {
+                "think": {
+                    "services": [
+                        "think\\app\\Service"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "think\\app\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "liu21st",
+                    "email": "liu21st@gmail.com"
+                }
+            ],
+            "description": "thinkphp6 multi app support",
+            "support": {
+                "issues": "https://github.com/top-think/think-multi-app/issues",
+                "source": "https://github.com/top-think/think-multi-app/tree/master"
+            },
+            "time": "2020-07-12T13:50:37+00:00"
+        },
+        {
+            "name": "topthink/think-orm",
+            "version": "v2.0.45",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/top-think/think-orm.git",
+                "reference": "3dcf9af447b048103093840833e8c74ab849152f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/top-think/think-orm/zipball/3dcf9af447b048103093840833e8c74ab849152f",
+                "reference": "3dcf9af447b048103093840833e8c74ab849152f",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "ext-pdo": "*",
+                "php": ">=7.1.0",
+                "psr/log": "~1.0",
+                "psr/simple-cache": "^1.0",
+                "topthink/think-helper": "^3.1"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^7|^8|^9.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "think\\": "src"
+                },
+                "files": [
+                    "stubs/load_stubs.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "liu21st",
+                    "email": "liu21st@gmail.com"
+                }
+            ],
+            "description": "think orm",
+            "keywords": [
+                "database",
+                "orm"
+            ],
+            "support": {
+                "issues": "https://github.com/top-think/think-orm/issues",
+                "source": "https://github.com/top-think/think-orm/tree/v2.0.45"
+            },
+            "time": "2021-11-30T14:31:05+00:00"
+        }
+    ],
+    "packages-dev": [
+        {
+            "name": "symfony/polyfill-mbstring",
+            "version": "v1.23.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-mbstring.git",
+                "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6",
+                "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "suggest": {
+                "ext-mbstring": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.23-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Mbstring\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for the Mbstring extension",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "mbstring",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-05-27T12:26:48+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php72",
+            "version": "v1.23.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php72.git",
+                "reference": "9a142215a36a3888e30d0a9eeea9766764e96976"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976",
+                "reference": "9a142215a36a3888e30d0a9eeea9766764e96976",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.23-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Php72\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-05-27T09:17:38+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php80",
+            "version": "v1.23.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php80.git",
+                "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be",
+                "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.23-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Php80\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ],
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Ion Bazan",
+                    "email": "ion.bazan@gmail.com"
+                },
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-07-28T13:41:28+00:00"
+        },
+        {
+            "name": "symfony/var-dumper",
+            "version": "v4.4.34",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/var-dumper.git",
+                "reference": "2d0c056b2faaa3d785bdbd5adecc593a5be9c16e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2d0c056b2faaa3d785bdbd5adecc593a5be9c16e",
+                "reference": "2d0c056b2faaa3d785bdbd5adecc593a5be9c16e",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1.3",
+                "symfony/polyfill-mbstring": "~1.0",
+                "symfony/polyfill-php72": "~1.5",
+                "symfony/polyfill-php80": "^1.16"
+            },
+            "conflict": {
+                "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
+                "symfony/console": "<3.4"
+            },
+            "require-dev": {
+                "ext-iconv": "*",
+                "symfony/console": "^3.4|^4.0|^5.0",
+                "symfony/process": "^4.4|^5.0",
+                "twig/twig": "^1.43|^2.13|^3.0.4"
+            },
+            "suggest": {
+                "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
+                "ext-intl": "To show region name in time zone dump",
+                "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
+            },
+            "bin": [
+                "Resources/bin/var-dump-server"
+            ],
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "Resources/functions/dump.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Component\\VarDumper\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Provides mechanisms for walking through any arbitrary PHP variable",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "debug",
+                "dump"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/var-dumper/tree/v4.4.34"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2021-11-12T10:50:54+00:00"
+        },
+        {
+            "name": "topthink/think-trace",
+            "version": "v1.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/top-think/think-trace.git",
+                "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/top-think/think-trace/zipball/9a9fa8f767b6c66c5a133ad21ca1bc96ad329444",
+                "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1.0",
+                "topthink/framework": "^6.0.0"
+            },
+            "type": "library",
+            "extra": {
+                "think": {
+                    "services": [
+                        "think\\trace\\Service"
+                    ],
+                    "config": {
+                        "trace": "src/config.php"
+                    }
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "think\\trace\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "liu21st",
+                    "email": "liu21st@gmail.com"
+                }
+            ],
+            "description": "thinkphp debug trace",
+            "support": {
+                "issues": "https://github.com/top-think/think-trace/issues",
+                "source": "https://github.com/top-think/think-trace/tree/v1.4"
+            },
+            "time": "2020-06-29T05:27:28+00:00"
+        }
+    ],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": {
+        "php": ">=7.1.0"
+    },
+    "platform-dev": [],
+    "plugin-api-version": "2.1.0"
+}

+ 33 - 0
config/app.php

@@ -0,0 +1,33 @@
+<?php
+// +----------------------------------------------------------------------
+// | 应用设置
+// +----------------------------------------------------------------------
+
+return [
+    // 应用地址
+    'app_host'         => env('app.host', ''),
+    // 应用的命名空间
+    'app_namespace'    => '',
+    // 是否启用路由
+    'with_route'       => true,
+    // 默认应用
+    'default_app'      => 'index',
+    // 默认时区
+    'default_timezone' => 'Asia/Shanghai',
+
+    // 应用映射(自动多应用模式有效)
+    'app_map'          => [],
+    // 域名绑定(自动多应用模式有效)
+    'domain_bind'      => [],
+    // 禁止URL访问的应用列表(自动多应用模式有效)
+    'deny_app_list'    => [],
+
+    // 异常页面的模板文件
+    'exception_tmpl'   => app()->getThinkPath() . 'tpl/think_exception.tpl',
+
+    // 错误显示信息,非调试模式有效
+    'error_message'    => '页面错误!请稍后再试~',
+    // 显示错误信息
+    'show_error_msg'   => false,
+    "api_host"=>"http://inv.sitw.wanyuhengtong.com/"
+];

+ 29 - 0
config/cache.php

@@ -0,0 +1,29 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | 缓存设置
+// +----------------------------------------------------------------------
+
+return [
+    // 默认缓存驱动
+    'default' => env('cache.driver', 'file'),
+
+    // 缓存连接方式配置
+    'stores'  => [
+        'file' => [
+            // 驱动方式
+            'type'       => 'File',
+            // 缓存保存目录
+            'path'       => '',
+            // 缓存前缀
+            'prefix'     => '',
+            // 缓存有效期 0表示永久缓存
+            'expire'     => 0,
+            // 缓存标签前缀
+            'tag_prefix' => 'tag:',
+            // 序列化机制 例如 ['serialize', 'unserialize']
+            'serialize'  => [],
+        ],
+        // 更多的缓存连接
+    ],
+];

+ 9 - 0
config/console.php

@@ -0,0 +1,9 @@
+<?php
+// +----------------------------------------------------------------------
+// | 控制台配置
+// +----------------------------------------------------------------------
+return [
+    // 指令定义
+    'commands' => [
+    ],
+];

+ 20 - 0
config/cookie.php

@@ -0,0 +1,20 @@
+<?php
+// +----------------------------------------------------------------------
+// | Cookie设置
+// +----------------------------------------------------------------------
+return [
+    // cookie 保存时间
+    'expire'    => 0,
+    // cookie 保存路径
+    'path'      => '/',
+    // cookie 有效域名
+    'domain'    => '',
+    //  cookie 启用安全传输
+    'secure'    => false,
+    // httponly设置
+    'httponly'  => false,
+    // 是否使用 setcookie
+    'setcookie' => true,
+    // samesite 设置,支持 'strict' 'lax'
+    'samesite'  => '',
+];

+ 63 - 0
config/database.php

@@ -0,0 +1,63 @@
+<?php
+
+return [
+    // 默认使用的数据库连接配置
+    'default'         => env('database.driver', 'mysql'),
+
+    // 自定义时间查询规则
+    'time_query_rule' => [],
+
+    // 自动写入时间戳字段
+    // true为自动识别类型 false关闭
+    // 字符串则明确指定时间字段类型 支持 int timestamp datetime date
+    'auto_timestamp'  => true,
+
+    // 时间字段取出后的默认时间格式
+    'datetime_format' => 'Y-m-d H:i:s',
+
+    // 时间字段配置 配置格式:create_time,update_time
+    'datetime_field'  => '',
+
+    // 数据库连接配置信息
+    'connections'     => [
+        'mysql' => [
+            // 数据库类型
+            'type'            => env('database.type', 'mysql'),
+            // 服务器地址
+            'hostname'        => env('database.hostname', '120.46.155.214'),
+            // 数据库名
+            'database'        => env('database.database', 'bugonline'),
+            // 用户名
+            'username'        => env('database.username', 'root'),
+            // 密码
+            'password'        => env('database.password', 'test!@#wyht123'),
+            // 端口
+            'hostport'        => env('database.hostport', '3306'),
+            // 数据库连接参数
+            'params'          => [],
+            // 数据库编码默认采用utf8
+            'charset'         => env('database.charset', 'utf8'),
+            // 数据库表前缀
+            'prefix'          => env('database.prefix', 'devcloud_'),
+
+            // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
+            'deploy'          => 0,
+            // 数据库读写是否分离 主从式有效
+            'rw_separate'     => false,
+            // 读写分离后 主服务器数量
+            'master_num'      => 1,
+            // 指定从服务器序号
+            'slave_no'        => '',
+            // 是否严格检查字段是否存在
+            'fields_strict'   => true,
+            // 是否需要断线重连
+            'break_reconnect' => false,
+            // 监听SQL
+            'trigger_sql'     => env('app_debug', true),
+            // 开启字段缓存
+            'fields_cache'    => false,
+        ],
+
+        // 更多的数据库配置信息
+    ],
+];

+ 24 - 0
config/filesystem.php

@@ -0,0 +1,24 @@
+<?php
+
+return [
+    // 默认磁盘
+    'default' => env('filesystem.driver', 'local'),
+    // 磁盘列表
+    'disks'   => [
+        'local'  => [
+            'type' => 'local',
+            'root' => app()->getRuntimePath() . 'storage',
+        ],
+        'public' => [
+            // 磁盘类型
+            'type'       => 'local',
+            // 磁盘路径
+            'root'       => app()->getRootPath() . 'public/storage',
+            // 磁盘路径对应的外部URL路径
+            'url'        => '/storage',
+            // 可见性
+            'visibility' => 'public',
+        ],
+        // 更多的磁盘配置信息
+    ],
+];

+ 27 - 0
config/lang.php

@@ -0,0 +1,27 @@
+<?php
+// +----------------------------------------------------------------------
+// | 多语言设置
+// +----------------------------------------------------------------------
+
+return [
+    // 默认语言
+    'default_lang'    => env('lang.default_lang', 'zh-cn'),
+    // 允许的语言列表
+    'allow_lang_list' => [],
+    // 多语言自动侦测变量名
+    'detect_var'      => 'lang',
+    // 是否使用Cookie记录
+    'use_cookie'      => true,
+    // 多语言cookie变量
+    'cookie_var'      => 'think_lang',
+    // 多语言header变量
+    'header_var'      => 'think-lang',
+    // 扩展语言包
+    'extend_list'     => [],
+    // Accept-Language转义为对应语言包名称
+    'accept_language' => [
+        'zh-hans-cn' => 'zh-cn',
+    ],
+    // 是否支持语言分组
+    'allow_group'     => false,
+];

+ 45 - 0
config/log.php

@@ -0,0 +1,45 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | 日志设置
+// +----------------------------------------------------------------------
+return [
+    // 默认日志记录通道
+    'default'      => env('log.channel', 'file'),
+    // 日志记录级别
+    'level'        => [],
+    // 日志类型记录的通道 ['error'=>'email',...]
+    'type_channel' => [],
+    // 关闭全局日志写入
+    'close'        => false,
+    // 全局日志处理 支持闭包
+    'processor'    => null,
+
+    // 日志通道列表
+    'channels'     => [
+        'file' => [
+            // 日志记录方式
+            'type'           => 'File',
+            // 日志保存目录
+            'path'           => '',
+            // 单文件日志写入
+            'single'         => false,
+            // 独立日志级别
+            'apart_level'    => [],
+            // 最大日志文件数量
+            'max_files'      => 0,
+            // 使用JSON格式记录
+            'json'           => false,
+            // 日志处理
+            'processor'      => null,
+            // 关闭通道日志写入
+            'close'          => false,
+            // 日志输出格式化
+            'format'         => '[%s][%s] %s',
+            // 是否实时写入
+            'realtime_write' => false,
+        ],
+        // 其它日志通道配置
+    ],
+
+];

+ 8 - 0
config/middleware.php

@@ -0,0 +1,8 @@
+<?php
+// 中间件配置
+return [
+    // 别名或分组
+    'alias'    => [],
+    // 优先级设置,此数组中的中间件会按照数组中的顺序优先执行
+    'priority' => [],
+];

+ 22 - 0
config/note.php

@@ -0,0 +1,22 @@
+<?php
+return [
+    'field'=>[
+        "title"=>'标题',
+        "level"=>'优先级',
+        "status"=>'处理状态',
+        "remark"=>'描述',
+        "type"=>'需求类型',
+        "noteNo"=>'业务编号',
+        "model_id"=>"功能区",
+        "deal_name"=>'处理人'
+    ],
+    "field_value"=>[
+        "type"=>[
+            '缺陷(Bug)','任务(Task)','需求(Story)'
+        ],
+        "level"=>[ 1=>'高',2=>'中',3=>'低'],
+        "status"=>["待处理","进行中","已解决","测试中","已拒绝","已关闭","延后处理"],
+        "company_type"=>[1=>"结算系统",2=>'516系统',3=>'订单系统'],
+    ]
+
+];

+ 45 - 0
config/route.php

@@ -0,0 +1,45 @@
+<?php
+// +----------------------------------------------------------------------
+// | 路由设置
+// +----------------------------------------------------------------------
+
+return [
+    // pathinfo分隔符
+    'pathinfo_depr'         => '/',
+    // URL伪静态后缀
+    'url_html_suffix'       => 'html',
+    // URL普通方式参数 用于自动生成
+    'url_common_param'      => true,
+    // 是否开启路由延迟解析
+    'url_lazy_route'        => false,
+    // 是否强制使用路由
+    'url_route_must'        => false,
+    // 合并路由规则
+    'route_rule_merge'      => false,
+    // 路由是否完全匹配
+    'route_complete_match'  => false,
+    // 访问控制器层名称
+    'controller_layer'      => 'controller',
+    // 空控制器名
+    'empty_controller'      => 'Error',
+    // 是否使用控制器后缀
+    'controller_suffix'     => false,
+    // 默认的路由变量规则
+    'default_route_pattern' => '[\w\.]+',
+    // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
+    'request_cache_key'     => false,
+    // 请求缓存有效期
+    'request_cache_expire'  => null,
+    // 全局请求缓存排除规则
+    'request_cache_except'  => [],
+    // 默认控制器名
+    'default_controller'    => 'Index',
+    // 默认操作名
+    'default_action'        => 'index',
+    // 操作方法后缀
+    'action_suffix'         => '',
+    // 默认JSONP格式返回的处理方法
+    'default_jsonp_handler' => 'jsonpReturn',
+    // 默认JSONP处理方法
+    'var_jsonp_handler'     => 'callback',
+];

+ 19 - 0
config/session.php

@@ -0,0 +1,19 @@
+<?php
+// +----------------------------------------------------------------------
+// | 会话设置
+// +----------------------------------------------------------------------
+
+return [
+    // session name
+    'name'           => 'PHPSESSID',
+    // SESSION_ID的提交变量,解决flash上传跨域
+    'var_session_id' => '',
+    // 驱动方式 支持file cache
+    'type'           => 'file',
+    // 存储连接标识 当type使用cache的时候有效
+    'store'          => null,
+    // 过期时间
+    'expire'         => 1440,
+    // 前缀
+    'prefix'         => '',
+];

+ 10 - 0
config/trace.php

@@ -0,0 +1,10 @@
+<?php
+// +----------------------------------------------------------------------
+// | Trace设置 开启调试模式后有效
+// +----------------------------------------------------------------------
+return [
+    // 内置Html和Console两种方式 支持扩展
+    'type'    => 'Html',
+    // 读取的日志通道名
+    'channel' => '',
+];

+ 25 - 0
config/view.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | 模板设置
+// +----------------------------------------------------------------------
+
+return [
+    // 模板引擎类型使用Think
+    'type'          => 'Think',
+    // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
+    'auto_rule'     => 1,
+    // 模板目录名
+    'view_dir_name' => 'view',
+    // 模板后缀
+    'view_suffix'   => 'html',
+    // 模板文件名分隔符
+    'view_depr'     => DIRECTORY_SEPARATOR,
+    // 模板引擎普通标签开始标记
+    'tpl_begin'     => '{',
+    // 模板引擎普通标签结束标记
+    'tpl_end'       => '}',
+    // 标签库标签开始标记
+    'taglib_begin'  => '{',
+    // 标签库标签结束标记
+    'taglib_end'    => '}',
+];

+ 0 - 0
public/.htaccess


BIN
public/favicon.ico


+ 26 - 0
public/index.php

@@ -0,0 +1,26 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+// [ 应用入口文件 ]
+namespace think;
+
+require __DIR__ . '/../vendor/autoload.php';
+header('Access-Control-Allow-Origin:*');
+header('Access-Control-Allow-Methods:POST,GET,OPTIONS,DELETE');
+header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
+// 执行HTTP应用并响应
+$http = (new App())->http;
+
+$response = $http->run();
+
+$response->send();
+
+$http->end($response);

+ 4 - 0
public/nginx.htaccess

@@ -0,0 +1,4 @@
+if (!-e $request_filename) {
+   rewrite  ^/(.*)$  /index.php/$1  last;
+   break;
+}

+ 2 - 0
public/robots.txt

@@ -0,0 +1,2 @@
+User-agent: *
+Disallow:

+ 19 - 0
public/router.php

@@ -0,0 +1,19 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+// $Id$
+
+if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
+    return false;
+} else {
+    $_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php';
+
+    require __DIR__ . "/index.php";
+}

BIN
public/storage/topic/20211216/e2d170c95faa7ce010d3d16607c54e3_20211216200628.png


BIN
public/storage/topic/20211216/e2d170c95faa7ce010d3d16607c54e3_20211216200707.png


BIN
public/storage/topic/20220418/1_20220418194211.png


BIN
public/storage/topic/20220418/image_20220418194247.png


BIN
public/storage/topic/20220419/image_20220419120118.png


BIN
public/storage/topic/20220420/image_20220420095703.png


BIN
public/storage/topic/20220420/image_20220420095937.png


BIN
public/storage/topic/20220420/image_20220420100104.png


BIN
public/storage/topic/20220426/image_20220426130519.png


BIN
public/storage/topic/20220426/image_20220426130616.png


BIN
public/storage/topic/20220426/image_20220426130649.png


BIN
public/storage/topic/20220426/image_20220426130900.png


BIN
public/storage/topic/20220426/image_20220426131130.png


BIN
public/storage/topic/20220426/image_20220426131309.png


BIN
public/storage/topic/20220427/image_20220427131844.png


BIN
public/storage/topic/20220427/image_20220427143531.png


BIN
public/storage/topic/20220427/image_20220427144252.png


BIN
public/storage/topic/20220427/image_20220427145740.png


BIN
public/storage/topic/20220427/image_20220427145934.png


BIN
public/storage/topic/20220427/image_20220427150138.png


BIN
public/storage/topic/20220427/image_20220427150513.png


BIN
public/storage/topic/20220427/image_20220427150526.png


BIN
public/storage/topic/20220427/image_20220427151143.png


BIN
public/storage/topic/20220427/image_20220427151316.png


BIN
public/storage/topic/20220427/image_20220427151331.png


BIN
public/storage/topic/20220427/image_20220427152131.png


BIN
public/storage/topic/20220427/image_20220427152508.png


BIN
public/storage/topic/20220427/image_20220427161244.png


BIN
public/storage/topic/20220427/image_20220427163502.png


BIN
public/storage/topic/20220428/image_20220428094534.png


BIN
public/storage/topic/20220428/image_20220428095524.png


BIN
public/storage/topic/20220428/image_20220428095804.png


BIN
public/storage/topic/20220428/image_20220428101533.png


BIN
public/storage/topic/20220428/image_20220428101743.png


BIN
public/storage/topic/20220428/image_20220428101821.png


BIN
public/storage/topic/20220428/image_20220428101903.png


BIN
public/storage/topic/20220428/image_20220428112407.png


BIN
public/storage/topic/20220428/image_20220428112844.png


BIN
public/storage/topic/20220428/image_20220428131914.png


BIN
public/storage/topic/20220428/image_20220428132404.png


BIN
public/storage/topic/20220428/image_20220428171352.png


BIN
public/storage/topic/20220428/image_20220428171428.png


BIN
public/storage/topic/20220428/image_20220428171758.png


BIN
public/storage/topic/20220428/image_20220428172851.png


BIN
public/storage/topic/20220428/image_20220428173015.png


BIN
public/storage/topic/20220428/image_20220428173153.png


BIN
public/storage/topic/20220505/image_20220505150258.png


BIN
public/storage/topic/20220505/image_20220505151221.png


BIN
public/storage/topic/20220507/image_20220507132402.png


Some files were not shown because too many files changed in this diff