|
|
@@ -52,7 +52,7 @@ class OrderServices
|
|
|
// 判断是不是首冲礼包
|
|
|
if (!empty($GiftsID)) {
|
|
|
|
|
|
- if ($GiftsID < 100) { // 礼包--首冲
|
|
|
+ if ($GiftsID == 301) { // 礼包--首冲
|
|
|
$GiftsData = [
|
|
|
'UserID' => $user_id,
|
|
|
'GiftsID' => $GiftsID,
|
|
|
@@ -80,75 +80,25 @@ class OrderServices
|
|
|
$Recharge = $Gifts->Price;
|
|
|
$czReason = 50;
|
|
|
$cjReason = 51;
|
|
|
- } elseif ($GiftsID > 100 && $GiftsID < 200) { // 周卡
|
|
|
- $CardID = $GiftsID - 100;
|
|
|
- $WeeklyCard = DB::connection('write')->table('QPPlatformDB.dbo.MonthCard')->where('CardID', $CardID)->first();
|
|
|
- $favorable_price = $WeeklyCard->FirstReward / 100;
|
|
|
- $Recharge = $WeeklyCard->Price;
|
|
|
- } elseif (false) {//$GiftsID == 200 || $GiftsID == 201) { // 20元首充
|
|
|
-
|
|
|
- $RechargeNum = $this->FirstCharge * NumConfig::NUM_VALUE;
|
|
|
- $give = $this->FirstChargeGive; // 赠送
|
|
|
- $firstPayExists = DB::table(TableName::QPAccountsDB() . 'UserRechargeActive')->where('UserID', $user_id)->first();
|
|
|
- if (!$firstPayExists) {
|
|
|
- DB::table(TableName::QPAccountsDB() . 'UserRechargeActive')
|
|
|
- ->insert([
|
|
|
- 'UserID' => $user_id,
|
|
|
- 'RechargeNum' => $RechargeNum,
|
|
|
- 'RewardDate' => date('Ymd'),
|
|
|
- 'FinishDate' => date('Ymd'),
|
|
|
- 'TotalReward' => $RechargeNum + ($this->FirstChargeGive * NumConfig::NUM_VALUE),
|
|
|
- 'CreateTime' => now()
|
|
|
- ]);
|
|
|
-
|
|
|
+ }else if ($GiftsID > 400) {
|
|
|
+ $Status = 1;
|
|
|
+ $recharge_gear = DB::connection('write')->table('agent.dbo.recharge_gear')->where('first_pay', 0)->where('status', $Status)->where('money', $payAmt)->select('favorable_price', 'give')->first();
|
|
|
+ if(!$recharge_gear){
|
|
|
+ $Recharge=$payAmt;
|
|
|
+ $give=0;
|
|
|
+ }else{
|
|
|
+ $Recharge = $recharge_gear->favorable_price;
|
|
|
+ $give = $recharge_gear->give;
|
|
|
}
|
|
|
- $favorable_price = $this->FirstCharge + $this->FirstChargeGive; // 充值
|
|
|
- $Recharge = $this->FirstCharge; // 充值
|
|
|
- $czReason = 1;
|
|
|
- $cjReason = 45;
|
|
|
|
|
|
- } elseif ($GiftsID == 200 || $GiftsID == 201 || $GiftsID == 211 || $GiftsID == 212) { // 引导付费礼包档位1 + 引导付费礼包档位2
|
|
|
- $first = DB::table('agent.dbo.recharge_gear')->where('gift_id', $GiftsID)->first();
|
|
|
- if ($first) {
|
|
|
- $Recharge = $first->favorable_price; // 充值
|
|
|
- $give = $first->give;
|
|
|
- $second_give = $first->second_give ?? 0;
|
|
|
- $favorable_price = $give + $Recharge; // 直接得到的金币
|
|
|
- $czReason = 1;
|
|
|
- $cjReason = 45;
|
|
|
- $RechargeNum = $Recharge * NumConfig::NUM_VALUE;
|
|
|
- if (!DB::table(TableName::QPAccountsDB() . 'UserRechargeActive')->where('UserID', $user_id)->exists()) {
|
|
|
- DB::table(TableName::QPAccountsDB() . 'UserRechargeActive')
|
|
|
- ->insert([
|
|
|
- 'UserID' => $user_id,
|
|
|
- 'RechargeNum' => $RechargeNum,
|
|
|
- 'RewardDate' => date('Ymd'),
|
|
|
- 'FinishDate' => date('Ymd'),
|
|
|
- 'TotalReward' => ($favorable_price + $second_give) * NumConfig::NUM_VALUE,
|
|
|
- 'CreateTime' => now()
|
|
|
- ]);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- } else if ($GiftsID > 300) {
|
|
|
- // 查找送的金额
|
|
|
- $recharge_gear = DB::connection('write')->table('agent.dbo.recharge_gear')->where('first_pay', 0)->where('money', $payAmt)->where('gift_id', $GiftsID)->select('favorable_price', 'give')->first();
|
|
|
- $Recharge = $recharge_gear->favorable_price;
|
|
|
- $give = $recharge_gear->give;
|
|
|
$favorable_price = $Recharge + $give;
|
|
|
$czReason = 1;
|
|
|
$cjReason = 45;
|
|
|
}
|
|
|
|
|
|
} else { // 普通订单
|
|
|
- // 查找送的金额
|
|
|
- $RechargeTimes=DB::table(TableName::QPRecordDB() . 'RecordUserTotalStatistics')->where('UserID', $user_id)->value('RechargeTimes')??0;
|
|
|
|
|
|
$Status = 1;
|
|
|
-// if($RechargeTimes>=4) {
|
|
|
-// }else{
|
|
|
-// $Status=$RechargeTimes+3;
|
|
|
-// }
|
|
|
$recharge_gear = DB::connection('write')->table('agent.dbo.recharge_gear')->where('first_pay', 0)->where('status', $Status)->where('money', $payAmt)->select('favorable_price', 'give')->first();
|
|
|
if(!$recharge_gear){
|
|
|
$Recharge=$payAmt;
|
|
|
@@ -198,28 +148,20 @@ class OrderServices
|
|
|
DB::connection('write')->table('QPAccountsDB.dbo.YN_VIPAccount')
|
|
|
->where('UserID', $user_id)
|
|
|
->insert(['Recharge' => $payAmt, 'UserID' => $user_id]);
|
|
|
- }
|
|
|
-
|
|
|
- try {
|
|
|
- if($query>=100){
|
|
|
- $user=GlobalUserInfo::getGameUserInfo('UserID',$user_id);
|
|
|
- if($user){
|
|
|
- if($user->Channel == 99){
|
|
|
-
|
|
|
- GlobalUserInfo::where('UserID', $user_id)->update([ 'Channel' => 50]);
|
|
|
|
|
|
-
|
|
|
-// $user->Channel = 50;
|
|
|
-// $user->save();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }catch (\Exception $exception){
|
|
|
+ /* TODO
|
|
|
+ * 金币银币切换 GameScoreInfo 将score的数据复制到 InsureScore 把Score 字段置0 把 ScoreChange字段设置成1
|
|
|
+ * 清理用户的数据
|
|
|
+ * GameScoreInfo的MaxScore MaxWinscore清0
|
|
|
+ * RecordUserTotalStatistics 表 数据清0
|
|
|
+ * RecordUserDataStatisticsNew 表数据 清0
|
|
|
+ * RecordUserGameCount 关于用户的数据删除
|
|
|
+ *
|
|
|
+ */
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
if ($Recharge > 0) {
|
|
|
// 添加日志记录表
|
|
|
@@ -247,7 +189,7 @@ class OrderServices
|
|
|
|
|
|
// Util::WriteLog('xxxxx', [$userInfo->Channel, $channelConfig, $query, $firstScore, $channelConfig->Rate > 0 && $channelConfig->ContrlScore > 0, $channelConfig->MinScore * NumConfig::NUM_VALUE > $firstScore]);
|
|
|
|
|
|
- if ($channelConfig && !$query) {
|
|
|
+ if ($channelConfig && !$query && false) {
|
|
|
if ($channelConfig->Rate > 0 && $channelConfig->ContrlScore > 0) {
|
|
|
if ($channelConfig->MinScore * NumConfig::NUM_VALUE >= $firstScore) {
|
|
|
$openGames = config('games.openKGame');
|
|
|
@@ -379,17 +321,17 @@ class OrderServices
|
|
|
|
|
|
|
|
|
// 服务器通知
|
|
|
- $url = config('transfer.stock')['url'] . 'notifyPay';
|
|
|
- Log::info('中转服参数 ' . json_encode([
|
|
|
- 'userid' => $user_id, 'getScore' => $favorable_price, 'score' => $Score,
|
|
|
- 'giftsid' => empty($GiftsID) ? 0 : $GiftsID,
|
|
|
- 'url' => $url
|
|
|
- ]));
|
|
|
- $res = (new HttpCurl())->service($url, ['userid' => $user_id, 'getScore' => $favorable_price, 'score' => $Score, 'giftsid' => empty($GiftsID) ? 0 : $GiftsID]);
|
|
|
-
|
|
|
- Log::info('中转服 执行时间:' . ((Helper::millisecond() - $startTime) / 1000), [
|
|
|
- 'res' => $res,
|
|
|
- ]);
|
|
|
+// $url = config('transfer.stock')['url'] . 'notifyPay';
|
|
|
+// Log::info('中转服参数 ' . json_encode([
|
|
|
+// 'userid' => $user_id, 'getScore' => $favorable_price, 'score' => $Score,
|
|
|
+// 'giftsid' => empty($GiftsID) ? 0 : $GiftsID,
|
|
|
+// 'url' => $url
|
|
|
+// ]));
|
|
|
+// $res = (new HttpCurl())->service($url, ['userid' => $user_id, 'getScore' => $favorable_price, 'score' => $Score, 'giftsid' => empty($GiftsID) ? 0 : $GiftsID]);
|
|
|
+//
|
|
|
+// Log::info('中转服 执行时间:' . ((Helper::millisecond() - $startTime) / 1000), [
|
|
|
+// 'res' => $res,
|
|
|
+// ]);
|
|
|
|
|
|
|
|
|
// AF 事件
|