wupengfei 2 yıl önce
ebeveyn
işleme
3f10d21bb3
2 değiştirilmiş dosya ile 16 ekleme ve 3 silme
  1. 1 1
      .idea/workspace.xml
  2. 15 2
      application/api/controller/Report.php

+ 1 - 1
.idea/workspace.xml

@@ -250,7 +250,7 @@
       <workItem from="1677805207495" duration="7323000" />
       <workItem from="1678063982310" duration="24531000" />
       <workItem from="1678149106133" duration="24129000" />
-      <workItem from="1678236784872" duration="1119000" />
+      <workItem from="1678236784872" duration="1245000" />
     </task>
     <servers />
   </component>

+ 15 - 2
application/api/controller/Report.php

@@ -2,6 +2,7 @@
 namespace app\api\controller;
 use app\common\model\ArticleComment;
 use app\common\model\ArticleIntro;
+use app\common\model\DatumComment;
 use app\common\model\DatumIntro;
 use app\common\model\ReportCase;
 use app\common\model\User;
@@ -49,7 +50,7 @@ class Report extends Base
      * @url /api/Report/userReport
      * @method POST
      * @header name:Authorization require:1 desc:Token
-     * @param name:type type:int default:1 desc:举报类型(1视频2视频评论3会员,4资料,5图文6问答问题,7新闻8图文评论9新闻评论)
+     * @param name:type type:int default:1 desc:举报类型(1视频2视频评论3会员,4资料,5图文6问答问题,7新闻8图文评论9新闻评论,10资料评论
      * @param name:report_id type:int default:-- desc:举报内容的id
      * @param name:case_ids type:string default:-- desc:举报类目id串(逗号隔开)
      * @param name:content type:string default:-- desc:举报内容
@@ -91,7 +92,19 @@ class Report extends Base
                 break;
             case 7:
                 $check_id =  ArticleComment::where('id',$report_id)->value('id');
-                if(!$check_id) $this->error('问答问题不存在');
+                if(!$check_id) $this->error('评论不存在');
+                break;
+            case 8:
+                $check_id =  \app\common\model\Press::where('id',$report_id)->value('id');
+                if(!$check_id) $this->error('新闻不存在');
+                break;
+            case 9:
+                $check_id =  \app\common\model\PressComment::where('id',$report_id)->value('id');
+                if(!$check_id) $this->error('新闻不存在');
+                break;
+            case 10:
+                $check_id =  DatumComment::where('id',$report_id)->value('id');
+                if(!$check_id) $this->error('评论不存在');
                 break;
         }
         UserReport::report($this->user_id,$type,$report_id,$case_ids,$content);