chenhao 4 years ago
parent
commit
6005f679a0
1 changed files with 25 additions and 0 deletions
  1. 25 0
      application/api/controller/Community.php

+ 25 - 0
application/api/controller/Community.php

@@ -328,7 +328,32 @@ class Community extends Api
 
         return $this->success('', $user);
     }
+    /**
+     * 用户举报
+     * @param string $uid 用户id
+     */
+    public function jubao()
+    {
+        $uid = $this->request->get('uid');
+
+        if (!$uid) return $this->error('参数错误');
+
+        $user = $this->auth->getUser();
 
+        $data = [
+            'uid' => $user['id'],
+            'be_uid' => $uid,
+            'create_time' => time('Y-m-d H:i',time())
+        ];
+
+        $add = Db::name('jubao')->insert($data);
+
+        if ($add) {
+            return $this->success('举报成功,后台审核中');
+        } else {
+            return $this->error('操作失败');
+        }
+    }
     /**
      * 关注用户
      *