121708259@qq.com пре 3 година
родитељ
комит
1fb95798e7
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      app/Services/DynamicService.php

+ 4 - 2
app/Services/DynamicService.php

@@ -252,8 +252,9 @@ class DynamicService
             if(!$dynamic){
             if(!$dynamic){
                 throw new Exception("动态不存在");
                 throw new Exception("动态不存在");
             }
             }
+            $report_id = $dynamic->id;
         }else{
         }else{
-            if(!empty($userReportParam->id)&& $userReportParam->report_id>0){
+            if(!empty($userReportParam->report_id)&& $userReportParam->report_id>0){
                 $user = User::query()->where('id',$userReportParam->report_id)->first();
                 $user = User::query()->where('id',$userReportParam->report_id)->first();
             }
             }
             if(!empty($userReportParam->tencent_im_user_id)){
             if(!empty($userReportParam->tencent_im_user_id)){
@@ -262,10 +263,11 @@ class DynamicService
             if(!$user){
             if(!$user){
                 throw new Exception("用户不存在");
                 throw new Exception("用户不存在");
             }
             }
+            $report_id = $user->id;
         }
         }
         UserReportModel::query()->create([
         UserReportModel::query()->create([
            "user_id"=>$userReportParam->user_id,
            "user_id"=>$userReportParam->user_id,
-           "report_id"=>$userReportParam->report_id,
+           "report_id"=>$report_id,
            "type"=>$userReportParam->type,
            "type"=>$userReportParam->type,
            "content"=>htmlspecialchars($userReportParam->content),
            "content"=>htmlspecialchars($userReportParam->content),
            "info"=>htmlspecialchars($userReportParam->info),
            "info"=>htmlspecialchars($userReportParam->info),