Преглед изворни кода

feat: UN-71: 会员-奖金列表调整

kevin пре 1 година
родитељ
комит
c5ab910a27
1 измењених фајлова са 11 додато и 1 уклоњено
  1. 11 1
      common/helpers/bonus/BonusSend.php

+ 11 - 1
common/helpers/bonus/BonusSend.php

@@ -17,6 +17,8 @@ use common\helpers\user\Balance;
 use common\helpers\user\Info;
 use common\helpers\user\Reconsume;
 use common\libs\api\sms\SmsApi;
+use common\models\Countries;
+use common\models\CurrencyConversions;
 use common\models\DealType;
 use common\models\EliteLevel;
 use common\models\FlowRemainPv;
@@ -339,7 +341,15 @@ class BonusSend extends BaseObject {
 
                     // 绩效奖金发放
                     if ($data['BONUS_PB'] > 0) {
-                        UserPerformance::sentUserPerformance($data['USER_ID'], $data['BONUS_PB'], $data['PERIOD_NUM']);
+                        // 汇率
+                        $countryId = User::getEnCodeInfo($data['USER_ID'])['COUNTRY_ID'];
+                        $currencyId = Countries::getById($countryId)['LOCAL_CURRENCY_ID'];
+                        $bonusConversions = CurrencyConversions::getToUSDRate($currencyId, 'bonus');
+
+                        // 奖金转化为会员所在国家汇率后进行发放
+                        $localAmount = $data['BONUS_PB'] * $bonusConversions;
+                        // 奖金发放
+                        UserPerformance::sentUserPerformance($data['USER_ID'], $localAmount, $data['PERIOD_NUM']);
                     }
 
                     // 把记录标记为已发放状态