|
@@ -0,0 +1,46 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Http\Controllers\Wap\Other;
|
|
|
+
|
|
|
+use App\Http\Controllers\Wap\BaseController;
|
|
|
+use App\Modules\ShareFree\Services\UserComplaintsService;
|
|
|
+use Illuminate\Http\Request;
|
|
|
+use App\Http\Controllers\Controller;
|
|
|
+use DB;
|
|
|
+
|
|
|
+class ComplaintsController extends BaseController
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * 获取投诉标签
|
|
|
+ * @param Request $request
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function getComplaintTags(Request $request) {
|
|
|
+ $tags = array(
|
|
|
+ ['id'=>1,'name'=>'色情低俗'],
|
|
|
+ ['id'=>2,'name'=>'政治敏感'],
|
|
|
+ ['id'=>3,'name'=>'违法犯罪'],
|
|
|
+ ['id'=>4,'name'=>'广告骚扰'],
|
|
|
+ ['id'=>5,'name'=>'无法继续阅读'],
|
|
|
+ ['id'=>6,'name'=>'内容质量差'],
|
|
|
+ ['id'=>7,'name'=>'其它'],
|
|
|
+ );
|
|
|
+ return response()->success($tags);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function complaints(Request $request) {
|
|
|
+ if(!$this->checkUid()){
|
|
|
+ return response()->error('WAP_NOT_LOGIN');
|
|
|
+ }
|
|
|
+ $tag_id = $request->input('tag_id','');
|
|
|
+ $tag_name = $request->input('name','');
|
|
|
+ $content = $request->input('content','');
|
|
|
+ $uid = $this->uid;
|
|
|
+
|
|
|
+ if(empty($tag_id)){
|
|
|
+ return response()->error('PARAM_EMPTY');
|
|
|
+ }
|
|
|
+ $params = compact('tag_id','tag_name','content','uid');
|
|
|
+ UserComplaintsService::addComplaints($params);
|
|
|
+ }
|
|
|
+}
|