WIN-2308041133\Administrator 6 months ago
parent
commit
9bfeb2e4a0
1 changed files with 3 additions and 3 deletions
  1. 3 3
      application/api/controller/Pay.php

+ 3 - 3
application/api/controller/Pay.php

@@ -608,7 +608,6 @@ class Pay extends Api
 
 //        $datavideo_order=Db::name('video_share')->where(['vid'=>input('id'),'uid'=>input('uid')])->find();
 //        $datavideo_order1=Db::name('video_share')->where(['sid'=>input('id'),'uid'=>input('uid'),'lx'=>1])->find();
-        $sad = 1;
 //        $lx=input('lx');
         $num = input('num'); //购买的版权数量
         $uid = input('uid');
@@ -622,7 +621,7 @@ class Pay extends Api
             }
         }
         $user_share = Db::name('videolist')->where('id', $vid)->value('share');
-        $user_shares = $user_share - $num;
+        $user_shares = bcsub($user_share , $num, 0);
         if ($user_shares < 0) {
             $this->error(__('该局总版权只剩下' . $user_share . '份'));
         }
@@ -659,7 +658,8 @@ class Pay extends Api
 //        if (!input('pricebuy')) {
 //            $this->error(__('金额不对'));
 //        }
-        $price = input('price');
+//        $price = input('price');
+        $price =  Db::name('videolist')->where('id', input('vid'))->value('sharesprice');;
 //        $pricebuy = input('pricebuy');
 //            if(input('lx')==2){
 //                $price=input('priced');