WIN-2308041133\Administrator 6 months ago
parent
commit
47a314352e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      application/api/controller/Pay.php

+ 5 - 0
application/api/controller/Pay.php

@@ -616,6 +616,9 @@ class Pay extends Api
         if (empty($user)){
             $this->error(__('用户不存在'));
         }
+        if (empty($num)){
+            $this->error(__('请输入数量'));
+        }
 
 //        验证数量
         $user_num = Db::name('video_user')->where('uid', $uid)->where('vid', $vid)->find();
@@ -627,6 +630,8 @@ class Pay extends Api
         }
         $user_share = Db::name('videolist')->where('id', $vid)->value('share');
         $user_shares = bcsub($user_share , $num, 0);
+        var_dump($user_share);
+        var_dump($user_shares);die();
         if ($user_shares < 0) {
             $this->error(__('该局总版权只剩下' . $user_share . '份'));
         }