Ken 2 săptămâni în urmă
părinte
comite
73f98604d1

+ 1 - 0
app/Models/Rebate.php

@@ -12,6 +12,7 @@ class Rebate extends BaseModel
     protected $fillable = ['date', 'member_id', 'betting_amount', 'rebate_ratio',
     protected $fillable = ['date', 'member_id', 'betting_amount', 'rebate_ratio',
         'amount', 'status', 'first_name', 'username', 'audited_by',
         'amount', 'status', 'first_name', 'username', 'audited_by',
         'profit', 'huishui_percentage', 'huishui_restriction', 'huishui_amount',
         'profit', 'huishui_percentage', 'huishui_restriction', 'huishui_amount',
+        'effective_betting_amount'
     ];
     ];
     const STATUS_WEI_FAN_YONG = 0;//未返佣
     const STATUS_WEI_FAN_YONG = 0;//未返佣
     const STATUS_FAN_YONG = 1; //已返佣
     const STATUS_FAN_YONG = 1; //已返佣

+ 12 - 12
app/Services/BetService.php

@@ -362,17 +362,14 @@ class BetService extends BaseService
         BalanceLogService::addLog($memberId, -$amount, $balance, ($balance - $amount), '投注', $bet_id, '');
         BalanceLogService::addLog($memberId, -$amount, $balance, ($balance - $amount), '投注', $bet_id, '');
 
 
 
 
-        //记录反水
+        //记录投注金额
         $rebate = Rebate::addOrUpdate([
         $rebate = Rebate::addOrUpdate([
             'member_id' => $memberId,
             'member_id' => $memberId,
             'betting_amount' => $amount,
             'betting_amount' => $amount,
             'first_name' => $userInfo->first_name,
             'first_name' => $userInfo->first_name,
             'username' => $userInfo->username,
             'username' => $userInfo->username,
         ]);
         ]);
-        if (!RebateService::BibiReturn($rebate, $amount)) {
-            $errText .= lang("笔笔返失败");
-            return false;
-        }
+
 
 
         $odds = floatval($gameplayRuleInfo['odds']);
         $odds = floatval($gameplayRuleInfo['odds']);
         $issueNo = $issueInfo->issue_no;
         $issueNo = $issueInfo->issue_no;
@@ -785,12 +782,16 @@ class BetService extends BaseService
 
 
                 // $yl = $profit - $amount;
                 // $yl = $profit - $amount;
                 $yl = bcsub($profit, $amount, 2); // 盈利
                 $yl = bcsub($profit, $amount, 2); // 盈利
-//                if (!in_array('13操', $awards) && !in_array('14操', $awards)) {
-                Rebate::updateProfit([
+
+
+                $rebate = Rebate::updateProfit([
                     'member_id' => $v['member_id'],
                     'member_id' => $v['member_id'],
                     'profit' => $yl,
                     'profit' => $yl,
                 ]);
                 ]);
-//                }
+
+                if (!in_array('13操', $awards) && !in_array('14操', $awards)) {
+                    RebateService::BibiReturn($rebate, $v['amount']);
+                }
 
 
 
 
                 $memberList[$v['member_id']][] = [
                 $memberList[$v['member_id']][] = [
@@ -831,15 +832,14 @@ class BetService extends BaseService
 
 
                 }
                 }
             } else {
             } else {
-
-
-//                if (!in_array('13操', $awards) && !in_array('14操', $awards)) {
                 Rebate::updateProfit([
                 Rebate::updateProfit([
                     'member_id' => $v['member_id'],
                     'member_id' => $v['member_id'],
                     'profit' => ($v['amount'] * -1),
                     'profit' => ($v['amount'] * -1),
                 ]);
                 ]);
-//                }
 
 
+                if (!in_array('13操', $awards) && !in_array('14操', $awards)) {
+                    RebateService::BibiReturn($rebate, $v['amount']);
+                }
 
 
                 $profit = 0;
                 $profit = 0;
                 if (in_array('13操', $awards) || in_array('14操', $awards)) {
                 if (in_array('13操', $awards) || in_array('14操', $awards)) {

+ 2 - 1
app/Services/RebateService.php

@@ -9,7 +9,7 @@ use Carbon\Carbon;
 class RebateService extends BaseService
 class RebateService extends BaseService
 {
 {
 
 
-    public static $MODEL= Rebate::class;
+    public static $MODEL = Rebate::class;
 
 
     /**
     /**
      * @description: 获取查询条件
      * @description: 获取查询条件
@@ -108,6 +108,7 @@ class RebateService extends BaseService
                 $rebate->id,
                 $rebate->id,
                 "投注{$amount};比例:{$percentage}%");
                 "投注{$amount};比例:{$percentage}%");
         }
         }
+        $rebate->increment('effective_betting_amount', $amount);
         $rebate->increment("amount", $rebateAmount);
         $rebate->increment("amount", $rebateAmount);
         return true;
         return true;
     }
     }

+ 33 - 0
database/migrations/2026_01_13_153629_update_rebates.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('rebates', function (Blueprint $table) {
+            $table->decimal('effective_betting_amount',10,2)
+                ->default(0)->comment('有效投注金额');
+        });
+
+        //
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+    }
+};