Browse Source

mchsrv update available_predeposit

ayHaru 4 years ago
parent
commit
32918a5e84
1 changed files with 3 additions and 3 deletions
  1. 3 3
      mchsrv/control/merchant_info.php

+ 3 - 3
mchsrv/control/merchant_info.php

@@ -20,7 +20,7 @@ class merchant_infoControl extends mbMerchantControl
             $member_info['available_predeposit'] = 0;
         }
         if(!empty($merchant_info['credit_bonus'])) {
-            $member_info['available_predeposit'] = ncPriceFormat($member_info['available_predeposit'] - $member_info['credit_bonus']);
+            $member_info['available_predeposit'] = ncPriceFormat($member_info['available_predeposit'] - $merchant_info['credit_bonus']);
         }
         $merchant_info['member'] = $member_info;
 
@@ -88,13 +88,13 @@ class merchant_infoControl extends mbMerchantControl
     {
         $mchid = $this->mchid();
         $model_merchant = Model('merchant');
-        $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid], 'mchid,admin_id,name,company_name');
+        $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid], 'mchid,admin_id,name,company_name,credit_bonus');
         $model_member = Model('member');
         $member_info = $model_member->getMemberInfo(['member_id' => $merchant_info['admin_id']], 'available_predeposit');
         if (empty($member_info)) {
             $merchant_info['available_predeposit'] = 0;
         } else {
-            $merchant_info['available_predeposit'] = ncPriceFormat($member_info['available_predeposit']);
+            $merchant_info['available_predeposit'] = ncPriceFormat($member_info['available_predeposit'] - $merchant_info['credit_bonus']);
         }
 
         $statistics = $this->statistics();