From df60073f4fb06ea2d16984635e0714bae8a1f8e9 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Mon, 22 Dec 2025 18:03:35 +0800
Subject: [PATCH] 1.在总后台首页装修增加了活动专区和智能匹配 模块 2.目前活动专区获取的是发布需求最新的数据,智能匹配是用户没登录前也是获取发布需求最新数据,登录后会根据用户发布的需求,通过分类匹配到对应的数据 3.修复缴纳保证金报错 4.修复发布需求报错

---
 admin/app/api/controller/plus/business/Grade.php |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/admin/app/api/controller/plus/business/Grade.php b/admin/app/api/controller/plus/business/Grade.php
index 955bb25..40bd0b7 100644
--- a/admin/app/api/controller/plus/business/Grade.php
+++ b/admin/app/api/controller/plus/business/Grade.php
@@ -14,4 +14,64 @@
         $model = new GradeModel();
         return $this->renderSuccess('',$model->getLists());
     }
+    
+    /**
+     * 获取等级详情
+     * @param $grade_id
+     * @return array
+     */
+    public function detail($grade_id)
+    {
+        $model = new GradeModel();
+        $detail = $model->detail($grade_id);
+        if (!$detail) {
+            return $this->renderError('等级不存在');
+        }
+        return $this->renderSuccess($detail);
+    }
+    
+    /**
+     * 添加等级
+     */
+    public function add()
+    {
+        $param = request()->param();
+        if ((new GradeModel())->add($param)) {
+            return $this->renderSuccess('', '添加成功');
+        }
+        return $this->renderError('添加失败');
+    }
+    
+    /**
+     * 编辑等级
+     */
+    public function edit()
+    {
+        $param = request()->param();
+        $model = (new GradeModel())->detail($param['grade_id']);
+        if (!$model) {
+            return $this->renderError('等级不存在');
+        }
+        unset($param['grade_id']);
+        if ($model->edit($param)) {
+            return $this->renderSuccess('', '编辑成功');
+        }
+        return $this->renderError('编辑失败');
+    }
+    
+    /**
+     * 删除等级
+     */
+    public function delete()
+    {
+        $param = request()->param();
+        $model = (new GradeModel())->detail($param['grade_id']);
+        if (!$model) {
+            return $this->renderError('等级不存在');
+        }
+        if ($model->setDelete()) {
+            return $this->renderSuccess('', '删除成功');
+        }
+        return $this->renderError('该等级下存在名片,无法删除');
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.2