Browse Source

动态送礼物

lizhen_gitee 9 months ago
parent
commit
c2d648eaf6

+ 3 - 2
application/api/controller/Gift.php

@@ -81,12 +81,14 @@ class Gift extends Api
                 {
                     $this->error("您的金币不足");
                 }
+                $log_table = 'gift_user_typing';
             }else{
                 $user_jewel = model('wallet')->getWallet($this->auth->id,'jewel');
                 if($user_jewel < $giftvalue)
                 {
                     $this->error("您的钻石不足");
                 }
+                $log_table = 'gift_user_typing_jewel';
             }
 
 
@@ -99,9 +101,8 @@ class Gift extends Api
                 'number' => $number,
                 'price' => $giftvalue,
                 'createtime' => time(),
-                'wallettype' => $giftinfo['wallettype'],
             ];
-            $log_id = Db::name('gift_user_typing')->insertGetId($data);
+            $log_id = Db::name($log_table)->insertGetId($data);
             if(!$log_id){
                 Db::rollback();
                 $this->error('赠送失败');

+ 3 - 2
application/api/controller/Topicdongtai.php

@@ -598,11 +598,13 @@ class Topicdongtai extends Api
             if($user_gold < $giftvalue) {
                 $this->error("您的金币不足");
             }
+            $log_table = 'gift_user_dongtai';
         }else{
             $user_jewel = model('wallet')->getWallet($this->auth->id,'jewel');
             if($user_jewel < $giftvalue) {
                 $this->error("您的钻石不足");
             }
+            $log_table = 'gift_user_dongtai_jewel';
         }
 
         Db::startTrans();
@@ -616,9 +618,8 @@ class Topicdongtai extends Api
             'number' => $number,
             'price' => $giftvalue,
             'createtime' => time(),
-            'wallettype' => $giftinfo['wallettype'],
         ];
-        $log_id = Db::name('gift_user_dongtai')->insertGetId($data);
+        $log_id = Db::name($log_table)->insertGetId($data);
         if(!$log_id){
             Db::rollback();
             $this->error('赠送失败');

+ 1 - 1
application/api/library/ExceptionHandle.php

@@ -13,7 +13,7 @@ class ExceptionHandle extends Handle
 
     public function render(Exception $e)
     {
-        //return parent::render($e);
+        return parent::render($e);
         $statuscode = $code = 500;
         $msg = $e->getMessage();
         // 验证异常