Ver Fonte

转账不允许转给自己

zhangxiaobin há 1 ano atrás
pai
commit
3e21cce164
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      application/api/controller/Money.php

+ 4 - 0
application/api/controller/Money.php

@@ -1745,6 +1745,10 @@ class Money extends Common
         if($this->auth->power->transfer == 1){
             $this->error('您已经被限制消费-转账');
         }
+        //不允许给自己转账
+        if ($user_id == $this->auth->id) {
+            $this->error('不允许给自己转账');
+        }
         //验证被转账用户存在
         $check = Db::name('user')->where('id',$user_id)->find();
         if(empty($check)){