Browse Source

修改数据字段

邹景立 4 years ago
parent
commit
5e2725ad9f
1 changed files with 15 additions and 2 deletions
  1. 15 2
      app/data/controller/api/Data.php

+ 15 - 2
app/data/controller/api/Data.php

@@ -11,6 +11,19 @@ use think\admin\Controller;
  */
 class Data extends Controller
 {
+
+    /**
+     * 获取指定数据对象
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function getData()
+    {
+        $data = $this->_vali(['name.require' => '数据名称不能为空!']);
+        $this->success('获取数据对象', sysdata($data['name']));
+    }
+
     /**
      * 获取轮播图片数据
      * @throws \think\db\exception\DataNotFoundException
@@ -20,7 +33,7 @@ class Data extends Controller
     public function getSlider()
     {
         $data = sysdata(input('keys', 'slider'));
-        $this->success('获取轮播图片数据', $data);
+        $this->success('获取轮播图片', $data);
     }
 
     /**
@@ -36,6 +49,6 @@ class Data extends Controller
         if (($id = input('id')) > 0) {
             $this->app->db->name('BaseUserMessage')->where(['id' => $id])->inc('num_read')->update();
         }
-        $this->success('获取系统通知数据', $result);
+        $this->success('获取系统通知', $result);
     }
 }