Browse Source

Merge remote-tracking branch 'origin/develop' into develop

wzq 5 years ago
parent
commit
302527af51

+ 1 - 0
app/Console/Commands/BehaviorRecord.php

@@ -81,6 +81,7 @@ class BehaviorRecord extends Command
 
         $callback = function ($msg) {
             $param = \GuzzleHttp\json_decode($msg->body,true);
+            $this->line(date('Y-m-d H:i:s').'开始记录账本');
             $row = $this->behaviorRecordRepositories->addRecord($param);
             if($row){
                 $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);

+ 1 - 1
app/Console/Commands/ContentFeedCreate.php

@@ -81,7 +81,7 @@ class ContentFeedCreate extends Command
 
         $callback = function ($msg) {
             $param = \GuzzleHttp\json_decode($msg->body,true);
-            $this->line('收到消息'.$msg->body);
+            $this->line(date('Y-m-d H:i:s').'收到消息:'.$msg->body);
             $this->feedRepositories->contentCreate($param);
             $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);
         };

+ 4 - 4
app/Repositories/BehaviorRecordRepositories.php

@@ -112,7 +112,7 @@ class BehaviorRecordRepositories
             DB::commit();
             return true;
         } catch (QueryException $exception) {
-            Log::debug('记录账本-exception:'.$exception->getMessage());
+            Log::debug('记录账本-注册-exception:'.$exception->getMessage());
             DB::rollBack();
             return false;
         }
@@ -150,7 +150,7 @@ class BehaviorRecordRepositories
             DB::commit();
             return true;
         } catch (QueryException $exception) {
-            Log::debug('addReleaseRecord-exception:'.$exception->getMessage());
+            Log::debug('记录账本-发布-exception:'.$exception->getMessage());
             DB::rollBack();
             return false;
         }
@@ -189,7 +189,7 @@ class BehaviorRecordRepositories
             DB::commit();
             return true;
         } catch (QueryException $exception) {
-            Log::debug('addGeneralRecord-exception:'.$exception->getMessage());
+            Log::debug('记录账本-普通行为-exception:'.$exception->getMessage());
             DB::rollBack();
             return false;
         }
@@ -230,7 +230,7 @@ class BehaviorRecordRepositories
             DB::commit();
             return true;
         } catch (QueryException $exception) {
-            Log::debug('addCommentRecord-exception:'.$exception->getMessage());
+            Log::debug('记录账本-评论-exception:'.$exception->getMessage());
             DB::rollBack();
             return false;
         }

+ 4 - 1
app/Repositories/FeedRepositories.php

@@ -42,7 +42,10 @@ class FeedRepositories
      */
     public function contentCreate($request){
         $this->feedCreate($request);
-        $this->postRepositories->updatePostData($request);
+        //关注操作不需要调用
+        if($request['behavior_flag']!='focus'){
+            $this->postRepositories->updatePostData($request);
+        }
     }
 
 

+ 5 - 1
app/Repositories/PostRepositories.php

@@ -454,7 +454,11 @@ class PostRepositories
      */
     public function updatePostData($request)
     {
-        $postId = $request['post_id'];
+        $postId = isset($request['post_id'])?$request['post_id']:0;
+        if(empty($postId)){
+            Log::debug("非帖子类操作,不操作帖子统计数量".json_encode($request));
+            return true;
+        }
         $post = PostData::where('post_id', $postId)->first();
         if (isset($request['behavior_flag']) && $request['behavior_flag'] == 'read') {
             $post->pv += 1;