ssvfdn 3 months ago
parent
commit
8b2a935eef
1 changed files with 29 additions and 2 deletions
  1. 29 2
      app/controller/GameImproveUserRtp.php

+ 29 - 2
app/controller/GameImproveUserRtp.php

@@ -94,8 +94,22 @@ class GameImproveUserRtp extends BaseController
                 $info->net_income = $data['net_income'];
                 $info->trigger_interval_rounds = $data['trigger_interval_rounds'];
                 $info->turnover_multiple = $data['turnover_multiple'];
-                $this->custom_time_start = !empty($custom_time_start) ?  strtotime($custom_time_start) : 0;
-                $this->custom_time_end = !empty($custom_time_end) ?  strtotime($custom_time_end) : 0;
+                $info->custom_time_start = !empty($custom_time_start) ?  strtotime($custom_time_start) : 0;
+                $info->custom_time_end = !empty($custom_time_end) ?  strtotime($custom_time_end) : 0;
+
+
+                if($info->evaluation_period != 5) {
+                    $info->round_status = 1;
+                    $info->open_status_time = time();
+                }else {
+                    if(time() >= $info->custom_time_start) {
+                        $info->round_status = 1;
+                    }
+                    if(time() >= $info->custom_time_end) {
+                        $info->round_status = 2;
+                    }
+                    $info->open_status_time = $info->custom_time_start;
+                }
                 $info->save();
             }else {
                 // 添加
@@ -113,6 +127,19 @@ class GameImproveUserRtp extends BaseController
                     'old_rtp' => $merchantsUserInfo['rtp'],
                     'control_balance' => CommonUtils::convertBalance( $balanceInfo['balance'], false), // 设置时点控那刻当前余额
                 ];
+                if($item['evaluation_period'] != 5) {
+                    $item['round_status'] = 1;
+                    $item['open_status_time'] = time();
+                }else {
+                    if(time() >= $item['custom_time_start']) {
+                        $item['round_status'] = 1;
+                    }
+                    if(time() >= $item['custom_time_end']) {
+                        $item['round_status'] = 2;
+                    }
+                    $item['open_status_time'] = $item['custom_time_start'];
+                }
+
                 GameImproveUserRtpModel::create($item);
             }
         }