|
@@ -815,6 +815,21 @@ class User extends Api
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //查询是否举报过用户
|
|
|
|
+ public function getreportcount() {
|
|
|
|
+ $ruser_id = $this->request->request('ruser_id'); // 被举报用户ID
|
|
|
|
+ if (!$ruser_id) {
|
|
|
|
+ $this->error(__('Invalid parameters'));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $count = Db::name('user_report')->where(['user_id' => $this->auth->id, 'ruser_id' => $ruser_id, 'status' => 0])->count('id');
|
|
|
|
+ if ($count) {
|
|
|
|
+ $this->error('您已经举报过该用户,请耐心等待~');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $this->success('可以举报');
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 举报用户
|
|
* 举报用户
|
|
*/
|
|
*/
|