Bladeren bron

add send BS bonus api

kevin_zhangl 1 jaar geleden
bovenliggende
commit
2c0b440678
1 gewijzigde bestanden met toevoegingen van 29 en 0 verwijderingen
  1. 29 0
      console/controllers/ToolController.php

+ 29 - 0
console/controllers/ToolController.php

@@ -17,6 +17,7 @@ use common\helpers\Form;
 use common\helpers\LoggerTool;
 use common\helpers\ocr\OcrApi;
 use common\helpers\Tool;
+use common\helpers\user\Balance;
 use common\libs\api\sms\SmsApi;
 use common\libs\swoole\RPCApi;
 use common\models\CalcBonus;
@@ -24,6 +25,7 @@ use common\models\CalcBonusBS;
 use common\models\CalcBonusFX;
 use common\models\CalcBonusQY;
 use common\models\CalcBonusYC;
+use common\models\DealType;
 use common\models\EmployLevel;
 use common\models\FlowBonus;
 use common\models\FlowRemainPv;
@@ -368,4 +370,31 @@ class ToolController extends BaseController
 
         return true;
     }
+
+    public function actionStarCrownBonusPayout()
+    {
+        $periodAmount = 102.2;
+        $periodNum = 134;
+        $userId = '588993027624800256';
+        $userId = '571010686600220672';// todo: test
+
+        Balance::changeUserBonus($userId, 'bonus', $periodAmount, [
+            'CALC_ID' => '595035263307223040',
+            'REMARK' => 'From Period ' . $periodNum,
+            'PERIOD_NUM' => $periodNum,
+
+            'BS' => 102.2,
+            'BS_MNT' => 0,
+            'BS_ABBR' => 102.2,
+
+            'ORI_BS' => 102.2,
+            'ORI_BS_MNT' => 0,
+            'ORI_BS_ABBR' => 102.2,
+
+            'BONUS_TOTAL' => 102.2,
+
+            'DEAL_TYPE_ID' => DealType::BONUS_SEND,
+            'BONUS_ISSUE' => true,
+        ]);
+    }
 }