wesmiler 6 天之前
父节点
当前提交
4a07bb99c1

+ 0 - 70
app/Http/Controllers/Admin/MeetingController.php

@@ -1,70 +0,0 @@
-<?php
-
-namespace App\Http\Controllers\Admin;
-
-
-use App\Services\Common\MeetingService;
-
-/**
- * 会议
- */
-class MeetingController extends Backend
-{
-    public function __construct()
-    {
-        parent::__construct();
-        $this->service = new MeetingService();
-    }
-
-    /**
-     * 列表
-     */
-    public function index()
-    {
-        $params = request()->all();
-        $pageSize = isset($params['limit']) ? intval($params['limit']) : PERPAGE;
-        return $this->service->getDataList($params, $pageSize);
-    }
-
-    /**
-     * 编辑(处理投诉)
-     */
-    public function edit()
-    {
-        return $this->service->edit();
-    }
-
-    /**
-     * 删除
-     */
-    public function delete()
-    {
-        return $this->service->delete();
-    }
-
-    /**
-     * 修改状态
-     */
-    public function status()
-    {
-        return $this->service->status();
-    }
-
-    /**
-     * 获取详情
-     */
-    public function info()
-    {
-        $id = request()->get('id');
-        return $this->service->getInfo($id);
-    }
-
-    /**
-     * 获取
-     */
-    public function qrcode()
-    {
-        $id = request()->get('id');
-        return $this->service->getInfo($id);
-    }
-}

+ 0 - 62
app/Http/Controllers/Admin/MeetingRecordController.php

@@ -1,62 +0,0 @@
-<?php
-
-namespace App\Http\Controllers\Admin;
-
-use App\Services\Common\ComplaintService;
-use App\Services\Common\MeetingRecordService;
-use App\Services\Common\MeetingService;
-
-/**
- * 会议签到记录
- */
-class MeetingRecordController extends Backend
-{
-    public function __construct()
-    {
-        parent::__construct();
-        $this->service = new MeetingRecordService();
-    }
-
-    /**
-     * 列表
-     */
-    public function index()
-    {
-        $params = request()->all();
-        $pageSize = isset($params['limit']) ? intval($params['limit']) : PERPAGE;
-        return $this->service->getDataList($params, $pageSize);
-    }
-
-    /**
-     * 编辑(处理投诉)
-     */
-    public function edit()
-    {
-        return $this->service->edit();
-    }
-
-    /**
-     * 删除
-     */
-    public function delete()
-    {
-        return $this->service->delete();
-    }
-
-    /**
-     * 修改状态
-     */
-    public function status()
-    {
-        return $this->service->status();
-    }
-
-    /**
-     * 获取详情
-     */
-    public function info()
-    {
-        $id = request()->get('id');
-        return $this->service->getInfo($id);
-    }
-}

+ 0 - 145
app/Http/Controllers/Admin/StoreController.php

@@ -1,145 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
-// +----------------------------------------------------------------------
-// | 版权所有 2017~2021 LARAVEL研发中心
-// +----------------------------------------------------------------------
-// | 官方网站: http://www.laravel.cn
-// +----------------------------------------------------------------------
-// | Author: laravel开发员 <laravel.qq.com>
-// +----------------------------------------------------------------------
-
-namespace App\Http\Controllers\Admin;
-
-
-
-use App\Services\Common\StoreService;
-
-
-/**
- * 商户管理-控制器
- * @author laravel开发员
- * @since 2020/11/11
- * @package App\Http\Controllers
- */
-class StoreController extends Backend
-{
-    /**
-     * 构造函数
-     * @author laravel开发员
-     * @since 2020/11/11
-     */
-    public function __construct()
-    {
-        parent::__construct();
-        $this->service = new StoreService();
-    }
-
-    public function index()
-    {
-        $pageSize = request()->get('limit', 15);
-        $params = request()->all();
-        $params['store_id'] = $this->storeId;
-        return $this->service->getDataList($params, $pageSize);
-    }
-
-    /**
-     * 获取当前登录商家信息
-     * @return array
-     */
-    public function currentInfo()
-    {
-        $service = new StoreService();
-        $storeId = $this->storeId;
-        return $service->getCurrentStoreInfo($storeId);
-    }
-
-    /**
-     * 获取详情
-     * @return array
-     */
-    public function info()
-    {
-        return $this->service->info();
-    }
-
-    /**
-     * 审核商家
-     * @return array
-     */
-    public function confirm()
-    {
-        $params = request()->post();
-        if ($this->service->confirm($this->userId, $params)) {
-            return message($this->service->getError(), true);
-        } else {
-            return message($this->service->getError(), false);
-        }
-    }
-
-    /**
-     * 设置状态(禁用/启用)
-     * @return array
-     */
-    public function status()
-    {
-        $params = request()->post();
-        if ($this->service->setStatus($params)) {
-            return message($this->service->getError(), true);
-        } else {
-            return message($this->service->getError(), false);
-        }
-    }
-
-    /**
-     * 新增商家
-     * @return array
-     */
-    public function add()
-    {
-        $params = request()->post();
-        if ($this->service->edit($params)) {
-            return message($this->service->getError(), true);
-        } else {
-            return message($this->service->getError(), false);
-        }
-    }
-
-    /**
-     * 编辑商家
-     * @return array
-     */
-    public function edit()
-    {
-        $params = request()->post();
-        if ($this->service->edit($params)) {
-            return message($this->service->getError(), true);
-        } else {
-            return message($this->service->getError(), false);
-        }
-    }
-
-    /**
-     * 删除商家
-     * @return array
-     */
-    public function delete()
-    {
-        $params = request()->post();
-        if ($this->service->delete($params)) {
-            return message($this->service->getError(), true);
-        } else {
-            return message($this->service->getError(), false);
-        }
-    }
-
-    /**
-     * 选项列表
-     * @return mixed
-     */
-    public function options()
-    {
-        $result = $this->service->options();
-        return message(1002, true, $result);
-    }
-}

+ 0 - 53
app/Http/Controllers/Admin/SupervisorConsultRecordController.php

@@ -1,53 +0,0 @@
-<?php
-
-namespace App\Http\Controllers\Admin;
-
-use App\Services\Common\MeetingRecordService;
-use App\Services\Common\SupervisorConsultRecordService;
-
-/**
- * 导师咨询记录
- */
-class SupervisorConsultRecordController extends Backend
-{
-    public function __construct()
-    {
-        parent::__construct();
-        $this->service = new SupervisorConsultRecordService();
-    }
-
-    /**
-     * 列表
-     */
-    public function index()
-    {
-        $params = request()->all();
-        $pageSize = isset($params['limit']) ? intval($params['limit']) : PERPAGE;
-        return $this->service->getDataList($params, $pageSize);
-    }
-
-    /**
-     * 编辑(处理投诉)
-     */
-    public function edit()
-    {
-        return $this->service->edit();
-    }
-
-    /**
-     * 删除
-     */
-    public function delete()
-    {
-        return $this->service->delete();
-    }
-
-    /**
-     * 修改状态
-     */
-    public function status()
-    {
-        return $this->service->status($this->userId);
-    }
-
-}

+ 0 - 111
app/Http/Controllers/Admin/SupervisorsController.php

@@ -1,111 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
-// +----------------------------------------------------------------------
-// | 版权所有 2017~2021 LARAVEL研发中心
-// +----------------------------------------------------------------------
-// | 官方网站: http://www.laravel.cn
-// +----------------------------------------------------------------------
-// | Author: laravel开发员 <laravel.qq.com>
-// +----------------------------------------------------------------------
-
-namespace App\Http\Controllers\Admin;
-use App\Services\Common\SupervisorsService;
-
-/**
- * 导师管理-控制器
- * @author laravel开发员
- * @since 2020/11/11
- * @package App\Http\Controllers
- */
-class SupervisorsController extends Backend
-{
-    /**
-     * 构造函数
-     * @author laravel开发员
-     * @since 2020/11/11
-     * MemberController constructor.
-     */
-    public function __construct()
-    {
-        parent::__construct();
-        $this->service = new SupervisorsService();
-    }
-
-    /**
-     * 列表
-     * @return array
-     */
-    public function index()
-    {
-        $result = $this->service->getList();
-        return showJson($result['msg'], $result['code'] == 0, $result['data'] ?? [], $result['count'] ?? 0);
-    }
-
-    /**
-     * 选项列表
-     * @return mixed
-     */
-    public function options(){
-        $result = $this->service->options();
-        return message(1002,true, $result);
-    }
-
-    /**
-     * 搜索用户(用于下拉选择)
-     * @return array
-     */
-    public function search()
-    {
-        $keyword = request()->input('keyword', '');
-        $limit = request()->input('limit', 20);
-        
-        $result = $this->service->searchUsers($keyword, $limit);
-        return showJson($result['msg'], $result['code'] == 0, $result['data'] ?? []);
-    }
-
-    /**
-     * 获取详情
-     */
-    public function read()
-    {
-        $result = $this->service->getInfo();
-        return showJson($result['msg'], $result['code'] == 0, $result['data'] ?? []);
-    }
-
-    /**
-     * 添加
-     */
-    public function add()
-    {
-        $result = $this->service->edit();
-        return showJson($result['msg'], $result['code'] == 0);
-    }
-
-    /**
-     * 设置状态
-     */
-    public function status()
-    {
-        $result = $this->service->status();
-        return showJson($result['msg'], $result['code'] == 0);
-    }
-
-    /**
-     * 设置认证
-     */
-    public function auth()
-    {
-        $result = $this->service->auth();
-        return showJson($result['msg'], $result['code'] == 0);
-    }
-
-    /**
-     * 设置推荐
-     */
-    public function recommend()
-    {
-        $result = $this->service->recommend();
-        return showJson($result['msg'], $result['code'] == 0);
-    }
-}

+ 9 - 0
app/Services/Common/GoodsCategoryService.php

@@ -124,6 +124,15 @@ class GoodsCategoryService extends BaseService
             return false;
         }
 
+        $id = isset($param['id'])?$param['id']:0;
+        $type = isset($param['type'])?$param['type']:0;
+        $name = isset($param['name'])?$param['name']:'';
+        $checkId = $this->model->where(['name'=>$name,'type'=>$type,'mark'=>1])->whereNotIn('id', [$id])->value('id');
+        if($checkId){
+            $this->error = '分类名称已经存在';
+            return false;
+        }
+
         // 如果 pid 为 0,表示一级分类
         if (!isset($param['pid'])) {
             $param['pid'] = 0;