|
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
use App\Services\Payment\QianBaoService;
|
|
use App\Services\Payment\QianBaoService;
|
|
|
use App\Services\Payment\SanJinService;
|
|
use App\Services\Payment\SanJinService;
|
|
|
|
|
+use App\Services\ConfigService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 投注
|
|
* 投注
|
|
@@ -317,6 +318,8 @@ class PaymentOrderService extends BaseService
|
|
|
// 记录余额变动日志
|
|
// 记录余额变动日志
|
|
|
BalanceLogService::addLog($info->member_id, $payAmount, $balance, $available_balance, '三方充值', $info->id, '');
|
|
BalanceLogService::addLog($info->member_id, $payAmount, $balance, $available_balance, '三方充值', $info->id, '');
|
|
|
|
|
|
|
|
|
|
+ self::rechargesBibiReturn($info->member_id, $payAmount, $info->id);
|
|
|
|
|
+
|
|
|
$text = "✅ 支付成功 \n";
|
|
$text = "✅ 支付成功 \n";
|
|
|
$text .= "充值金额:{$payAmount} RMB \n";
|
|
$text .= "充值金额:{$payAmount} RMB \n";
|
|
|
$text .= "订单号:{$params['outTradeNo']} \n";
|
|
$text .= "订单号:{$params['outTradeNo']} \n";
|
|
@@ -335,7 +338,25 @@ class PaymentOrderService extends BaseService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 充值笔笔返
|
|
|
|
|
+ public static function rechargesBibiReturn($memberId,$payAmount,$info_id)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ $rate = ConfigService::getVal('recharges_bibi_return');
|
|
|
|
|
+ $amount = $payAmount * $rate;
|
|
|
|
|
+ if($rate > 0){
|
|
|
|
|
+ $wallet = WalletService::findOne(['member_id' => $memberId]);
|
|
|
|
|
+ $balance = $wallet->available_balance;
|
|
|
|
|
+ $available_balance = bcadd($balance, $amount, 10);
|
|
|
|
|
+ $wallet->available_balance = $available_balance;
|
|
|
|
|
+ $wallet->save();
|
|
|
|
|
|
|
|
|
|
+ BalanceLogService::addLog($memberId, $amount, $balance, $available_balance, '优惠活动', $info_id, '充值笔笔返');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|