|
@@ -238,8 +238,10 @@ class PostRecordService extends BaseService
|
|
|
if($status == 1){
|
|
if($status == 1){
|
|
|
MessageService::make()->pushMessage($postUserId, $msgData);
|
|
MessageService::make()->pushMessage($postUserId, $msgData);
|
|
|
}
|
|
}
|
|
|
|
|
+ $count = $this->model->where(['source_id'=>$sourceId,'type'=> 2,'status'=>1,'mark'=>1])->count('id');
|
|
|
$this->error = $status==1? '点赞成功':'取消点赞成功';
|
|
$this->error = $status==1? '点赞成功':'取消点赞成功';
|
|
|
- return ['id' => $sourceId];
|
|
|
|
|
|
|
+ $this->errorData = $status==2? [] : ['count'=>$count,'data'=>['id' => $sourceId,'user_id'=>$userId,'status'=>$status]];
|
|
|
|
|
+ return true;
|
|
|
}else{
|
|
}else{
|
|
|
if(!$sourceId = $this->model->insertGetId($data)){
|
|
if(!$sourceId = $this->model->insertGetId($data)){
|
|
|
$this->error = $status==1? '点赞失败':'取消点赞失败';
|
|
$this->error = $status==1? '点赞失败':'取消点赞失败';
|
|
@@ -251,7 +253,9 @@ class PostRecordService extends BaseService
|
|
|
MessageService::make()->pushMessage($postUserId, $msgData);
|
|
MessageService::make()->pushMessage($postUserId, $msgData);
|
|
|
}
|
|
}
|
|
|
$this->error = $status==1? '点赞成功':'取消点赞成功';
|
|
$this->error = $status==1? '点赞成功':'取消点赞成功';
|
|
|
- return ['id' => $sourceId];
|
|
|
|
|
|
|
+ $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]];
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|