Explorar o código

关注与取关

lizhen_gitee hai 1 ano
pai
achega
71d132f21f
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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();
         if($check){
-            $this->error('已经关注此人');
+            //取关
+            $rs = Db::name('user_follow')->where($map)->delete();
+            $this->success('操作成功');
         }
 
         Db::startTrans();