wesmiler 6 dní pred
rodič
commit
78c626ee70
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      app/Services/Api/PostRecordService.php

+ 2 - 2
app/Services/Api/PostRecordService.php

@@ -240,7 +240,7 @@ class PostRecordService extends BaseService
             }
             }
             $count = $this->model->where(['source_id'=>$sourceId,'type'=> 2,'status'=>1,'mark'=>1])->count('id');
             $count = $this->model->where(['source_id'=>$sourceId,'type'=> 2,'status'=>1,'mark'=>1])->count('id');
             $this->error = $status==1? '点赞成功':'取消点赞成功';
             $this->error = $status==1? '点赞成功':'取消点赞成功';
-            $this->errorData = $status==2? [] : ['count'=>$count,'data'=>['id' => $sourceId,'user_id'=>$userId,'status'=>$status]];
+            $this->errorData = $status==2? ['count'=>$count,'data'=>[]] : ['count'=>$count,'data'=>['id' => $sourceId,'user_id'=>$userId,'status'=>$status]];
             return true;
             return true;
         }else{
         }else{
             if(!$sourceId = $this->model->insertGetId($data)){
             if(!$sourceId = $this->model->insertGetId($data)){
@@ -254,7 +254,7 @@ class PostRecordService extends BaseService
             }
             }
             $this->error = $status==1? '点赞成功':'取消点赞成功';
             $this->error = $status==1? '点赞成功':'取消点赞成功';
             $count = $this->model->where(['source_id'=>$sourceId,'type'=> 2,'status'=>1,'mark'=>1])->count('id');
             $count = $this->model->where(['source_id'=>$sourceId,'type'=> 2,'status'=>1,'mark'=>1])->count('id');
-            $this->errorData = $status==2? [] : ['count'=>$count,'data'=>['id' => $sourceId,'user_id'=>$userId,'status'=>$status]];
+            $this->errorData = $status==2? ['count'=>$count,'data'=>[]] : ['count'=>$count,'data'=>['id' => $sourceId,'user_id'=>$userId,'status'=>$status]];
             return true;
             return true;
         }
         }
     }
     }