Commit 77d569ff authored by sugar's avatar sugar

首页样谱

parent c058d9fe
Pipeline #731 canceled with stages
......@@ -320,7 +320,7 @@ class Friend extends Api{
$like_where = ['circle_id' =>$circle_id,'user_id'=>$this->auth->id];
$like= FriendLikeModel::where($like_where)->find();
if(!$like){
Friend::where($where)->setInc('likes',1);
Friendcircle::where($where)->setInc('likes',1);
$data = [
'circle_id' =>$circle_id,
'user_id' =>$this->auth->id,
......@@ -331,10 +331,10 @@ class Friend extends Api{
$this->success('点赞成功');
}
if($like['status'] == 1){
Friend::where($where)->setDec('likes',1);
Friendcircle::where($where)->setDec('likes',1);
FriendLikeModel::update(['status' =>2],$like_where);
}else{
Friend::where($where)->setInc('likes',1);
Friendcircle::where($where)->setInc('likes',1);
FriendLikeModel::update(['status' =>1],$like_where);
}
$this->success('操作成功');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment