wesmiler 5 hari lalu
induk
melakukan
78c626ee70
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  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');
             $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;
         }else{
             if(!$sourceId = $this->model->insertGetId($data)){
@@ -254,7 +254,7 @@ class PostRecordService extends BaseService
             }
             $this->error = $status==1? '点赞成功':'取消点赞成功';
             $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;
         }
     }