wesmiler 3 лет назад
Родитель
Сommit
1363650229
1 измененных файлов с 62 добавлено и 0 удалено
  1. 62 0
      app/Services/Common/ConfigService.php

+ 62 - 0
app/Services/Common/ConfigService.php

@@ -0,0 +1,62 @@
+<?php
+// +----------------------------------------------------------------------
+// | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 LARAVEL研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.laravel.cn
+// +----------------------------------------------------------------------
+// | Author: laravel开发员 <laravel.qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services\Common;
+
+use App\Models\ConfigModel;
+use App\Services\BaseService;
+
+/**
+ * 配置管理-服务类
+ * @author laravel开发员
+ * @since 2020/11/11
+ * Class ConfigService
+ * @package App\Services\Common
+ */
+class ConfigService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author laravel开发员
+     * @since 2020/11/11
+     * ConfigService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new ConfigModel();
+    }
+
+    /**
+     * 获取配置列表
+     * @return array
+     * @since 2020/11/11
+     * @author laravel开发员
+     */
+    public function getList()
+    {
+        $param = request()->all();
+        // 查询条件
+        $map = [];
+        // 配置分组ID
+        $configgroupId = getter($param, "configgroupId", 0);
+        if ($configgroupId) {
+            $map[] = ['config_group_id', '=', $configgroupId];
+        }
+        // 配置标题
+        $title = getter($param, "title");
+        if ($title) {
+            $map[] = ['name', 'title', "%{$title}%"];
+        }
+        $list = $this->model->getList($map, [['sort', 'asc']]);
+        return message("操作成功", true, $list);
+    }
+
+}