xielin hace 5 años
padre
commit
d2580282ef
Se han modificado 1 ficheros con 20 adiciones y 0 borrados
  1. 20 0
      app/Repositories/PostRepositories.php

+ 20 - 0
app/Repositories/PostRepositories.php

@@ -126,6 +126,10 @@ class PostRepositories
             Log::debug('图片违规,请修正哦' . json_encode($detectionImageResult));
             return jsonError('图片违规,请修正哦');
         }
+        //如果为html时候,则imgs只是去把富文本的图片拿去鉴黄,但不做其他处理
+        if ($request['type'] == 'html') {
+            $imgs = [];
+        }
         $videoUrl = "";
         $videoId = "";
         if (isset($request['video']) && $request['video']) {
@@ -228,6 +232,22 @@ class PostRepositories
                 'collect_bean', $postData->collect_bean,
                 'created_at', $post->created_at);
             Log::info('post_create:' . $post->id . ',post_author:' . $post->uid . ',author_ip:' . getClientIp());
+            $behavior = Behavior::where('behavior_identification', 'publish')->first();
+            if ('html' == $post->type && $behavior) {
+                $data = [
+                    "behavior_id" => $behavior['virus_behavior_id'],
+                    "behavior_flag" => "publish",
+                    "post_id" => $post->id,
+                    "post_type" => $post->type,
+                    "post_desc" => $post->title?$post->title:subtext($post->conetnt,100),
+                    "post_cover" => $post->img,
+                    "target_id" => $post->uid,
+                    "action_id" => $post->id,  //传帖子ID
+                ];
+                Log::debug('h5邀请用户注册' . json_encode($data));
+                //扔进virus队列
+                $this->rabbitMqUtil->push('virus_add', $data);
+            }
             return jsonSuccess([
                 'post_id' => $post->id,
                 'h5url' => config('customer.share_post_h5url') . "?post_id={$post->id}&invite_code={$userInfo['invite_code']}",