浏览代码

关注与取关

lizhen_gitee 1 年之前
父节点
当前提交
71d132f21f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      application/api/controller/Userfollow.php

+ 3 - 1
application/api/controller/Userfollow.php

@@ -151,7 +151,9 @@ class Userfollow extends Api
 
 
         $check = Db::name('user_follow')->where($map)->find();
         $check = Db::name('user_follow')->where($map)->find();
         if($check){
         if($check){
-            $this->error('已经关注此人');
+            //取关
+            $rs = Db::name('user_follow')->where($map)->delete();
+            $this->success('操作成功');
         }
         }
 
 
         Db::startTrans();
         Db::startTrans();