lizhen_gitee vor 2 Tagen
Ursprung
Commit
566542f154
2 geänderte Dateien mit 6 neuen und 15 gelöschten Zeilen
  1. 1 1
      addons/shopro/service/order/OrderCreate.php
  2. 5 14
      application/common/model/Wallet.php

+ 1 - 1
addons/shopro/service/order/OrderCreate.php

@@ -989,7 +989,7 @@ class OrderCreate
         }
 
         //善豆抵扣不能高于善豆余额
-        $user_bean = (new Wallet())->getWalletBak($this->user->id,'bean');
+        $user_bean = (new Wallet())->getWallet($this->user->id,'bean');
         $this->orderData['goods_bean_amount'] = $this->orderData['goods_bean_amount'] > $user_bean ? $user_bean : $this->orderData['goods_bean_amount'];
 
         //$temp_remain_pay_fee = bcsub($this->orderData['pay_fee'], $this->money, 2);

+ 5 - 14
application/common/model/Wallet.php

@@ -14,6 +14,11 @@ class Wallet extends BaseModel
     const log_type = [
         1  => '系统调节',//money + -
         10  => '用户充值',//money +
+        21 => '商务奖',
+        22 => '锁客奖',
+        23 => '业务员补贴',
+        24 => '业务员个人业绩',
+
         31 => '商城订单支付', //money -
         32 => '商城订单退款', //money +
         40 => '酒店预定',//money + -
@@ -73,20 +78,6 @@ class Wallet extends BaseModel
      * @param string $wallet_name 指定钱包名
      * @return array|float
      */
-    public function getWalletBak($user_id = 0, $wallet_name = '')
-    {
-        //所有钱包余额
-        if (!$wallet = Db::name('user_wallet')->where(['user_id' => $user_id])->find()) {
-            abort(500, '钱包余额获取失败');
-        }
-
-        if ($wallet_name) { //返回指定钱包
-            return isset($wallet[$wallet_name]) ? $wallet[$wallet_name] : 0;
-        } else { //返回所有钱包
-            return $wallet;
-        }
-    }
-
     public function getWallet($user_id = 0, $wallet_name = '')
     {
         //所有钱包余额