我的收藏
This commit is contained in:
@@ -105,8 +105,6 @@ class PostCommentService
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加后置处理
|
||||
*/
|
||||
@@ -123,4 +121,30 @@ class PostCommentService
|
||||
$post['comment'] = $post['comment']+1;
|
||||
$post->save();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加后置处理
|
||||
*/
|
||||
public function serviceDelete(Request $request)
|
||||
{
|
||||
$param = $request->all();
|
||||
|
||||
if (empty($param['id'])) {
|
||||
throw new \Exception("参数错误");
|
||||
}
|
||||
|
||||
$where = [];
|
||||
$where['id'] = $param['id'];
|
||||
$comment = PostComment::where($where)->first();
|
||||
|
||||
$post = Post::where(['id' => $comment['post_id']])->first();
|
||||
$post['comment'] = $post['comment']-1;
|
||||
$post->save();
|
||||
|
||||
$count = $comment->delete();
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
@@ -106,8 +106,6 @@ class UserService
|
||||
'openid' => $user->openid,
|
||||
'unionid' => $user->unionid,
|
||||
],
|
||||
// 'menu' => $menuTree,
|
||||
// 'permissions' => $permissionCodes
|
||||
];
|
||||
}
|
||||
|
||||
@@ -182,7 +180,7 @@ class UserService
|
||||
{
|
||||
// 对密码进行哈希处理
|
||||
$user = User::find($uid);
|
||||
$keysToKeep = ['name', 'avatar'];
|
||||
$keysToKeep = ['name', 'nickname', 'avatar'];
|
||||
|
||||
$data = array_intersect_key($data, array_flip($keysToKeep));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user