Tree hace 3 semanas
padre
commit
068dc34877

+ 1 - 0
app/Game/Services/OuroGameService.php

@@ -22,6 +22,7 @@ class OuroGameService
     const REASON_BindPhone=21;
     const REASON_BindPhone=21;
     const REASON_AgentBonus=2;
     const REASON_AgentBonus=2;
     const REASON_AgentWithDraw=81;
     const REASON_AgentWithDraw=81;
+    const REASON_RewardCode=90;
     public static function notifyWebHall($UserID,$GlobalUID="",$cmd='pay_finish',$data=["Golds"=>0,"PayNum"=>0]){
     public static function notifyWebHall($UserID,$GlobalUID="",$cmd='pay_finish',$data=["Golds"=>0,"PayNum"=>0]){
 
 
         try {
         try {

+ 170 - 0
app/Http/Controllers/Admin/RewardCodeController.php

@@ -0,0 +1,170 @@
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use App\Http\Controllers\Controller;
+use App\Models\RewardCode;
+use App\Services\RewardCodeService;
+use Carbon\Carbon;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+
+class RewardCodeController extends Controller
+{
+    /**
+     * Reward code list.
+     */
+    public function index(Request $request)
+    {
+        $query = RewardCode::query();
+
+        if ($code = $request->get('code')) {
+            $query->where('code', $code);
+        }
+        if ($status = $request->get('status', null)) {
+            $query->where('status', $status);
+        }
+        if ($expired = $request->get('expired', null)) {
+            if ($expired == 1) {
+                $query->whereNotNull('expire_at')->where('expire_at', '<', Carbon::now());
+            } elseif ($expired == 0) {
+                $query->where(function ($q) {
+                    $q->whereNull('expire_at')->orWhere('expire_at', '>=', Carbon::now());
+                });
+            }
+        }
+
+        $list = $query->orderByDesc('id')->paginate(20);
+
+        return view('admin.reward_code.index', [
+            'list' => $list,
+            'code' => $code ?? '',
+            'status' => $request->get('status', ''),
+            'expired' => $request->get('expired', ''),
+        ]);
+    }
+
+    /**
+     * Create single reward code.
+     */
+    public function store(Request $request)
+    {
+        $request->validate([
+            'total_amount' => 'required|numeric|min:0.0001',
+            'min_amount' => 'required|numeric|min:0.0001',
+            'max_amount' => 'required|numeric|min:0.0001',
+            'total_count' => 'required|integer|min:1',
+            'expire_at' => 'nullable|date',
+            'remark' => 'nullable|string|max:255',
+        ]);
+
+        $totalAmount = (float)$request->input('total_amount');
+        $minAmount = (float)$request->input('min_amount');
+        $maxAmount = (float)$request->input('max_amount');
+        $totalCount = (int)$request->input('total_count');
+        $expireAt = $request->input('expire_at') ? Carbon::parse($request->input('expire_at')) : null;
+        $remark = $request->input('remark', '');
+
+        if ($minAmount > $maxAmount) {
+            return apiReturnFail('min_amount_gt_max_amount');
+        }
+        if ($totalAmount < $minAmount * $totalCount) {
+            return apiReturnFail('total_amount_too_small_for_min');
+        }
+
+        $created = null;
+        DB::connection('write')->transaction(function () use ($totalAmount, $minAmount, $maxAmount, $totalCount, $expireAt, $remark, &$created) {
+            $code = RewardCodeService::generateUniqueCode();
+            $created = RewardCode::create([
+                'code' => $code,
+                'expire_at' => $expireAt,
+                'total_amount' => $totalAmount,
+                'min_amount' => $minAmount,
+                'max_amount' => $maxAmount,
+                'total_count' => $totalCount,
+                'claimed_count' => 0,
+                'claimed_amount' => 0,
+                'status' => RewardCodeService::STATUS_ACTIVE,
+                'remark' => $remark,
+            ]);
+        });
+
+        return redirect()->back()->with('success', 'Created, code: ' . $created->code);
+    }
+
+    /**
+     * Update status (enable/disable).
+     */
+    public function updateStatus(Request $request, $id)
+    {
+        $status = (int)$request->input('status', RewardCodeService::STATUS_ACTIVE);
+        if (!in_array($status, [RewardCodeService::STATUS_ACTIVE, RewardCodeService::STATUS_INACTIVE])) {
+            return apiReturnFail('invalid_status');
+        }
+        $code = RewardCode::find($id);
+        if (!$code) {
+            return apiReturnFail('code_not_found');
+        }
+        $code->status = $status;
+        $code->save();
+        return apiReturnSuc($code->toArray(), '', '¸üгɹ¦');
+    }
+
+    /**
+     * Claim records list.
+     */
+    public function records(Request $request)
+    {
+        $code = $request->get('code');
+        $userId = (int)$request->input('user_id', 0);
+        $gameId = (int)$request->input('game_id', 0);
+        $startDate = $request->input('start_date', '');
+        $endDate = $request->input('end_date', '');
+
+        $query = DB::connection('write')
+            ->table('agent.dbo.reward_code_claims as rcc')
+            ->leftJoin('QPAccountsDB.dbo.AccountsInfo as ai', 'rcc.UserID', '=', 'ai.UserID')
+            ->select(
+                'rcc.id',
+                'rcc.code',
+                'rcc.UserID',
+                'ai.GameID',
+                'ai.NickName',
+                'rcc.amount',
+                'rcc.client_ip',
+                'rcc.created_at'
+            )
+            ->orderBy('rcc.id', 'desc');
+
+        if ($code) {
+            $query->where('rcc.code', $code);
+        }
+
+        if ($userId > 0) {
+            $query->where('rcc.UserID', $userId);
+        }
+
+        if ($gameId > 0) {
+            $query->where('ai.GameID', $gameId);
+        }
+
+        if ($startDate) {
+            $query->where('rcc.created_at', '>=', $startDate . ' 00:00:00');
+        }
+        if ($endDate) {
+            $query->where('rcc.created_at', '<=', $endDate . ' 23:59:59');
+        }
+
+        $list = $query->paginate(20);
+
+        return view('admin.reward_code.history', [
+            'list' => $list,
+            'code' => $code ?? '',
+            'user_id' => $userId,
+            'game_id' => $gameId,
+            'start_date' => $startDate,
+            'end_date' => $endDate,
+        ]);
+    }
+}
+

+ 1 - 1
app/Http/Controllers/Game/LoginController.php

@@ -662,7 +662,7 @@ class LoginController extends Controller
                                 $user->update(['PwaInstalled' => 1]);
                                 $user->update(['PwaInstalled' => 1]);
                                 $config = RouteService::getChannelConfig($request);
                                 $config = RouteService::getChannelConfig($request);
                                 if($config->BONUS_PWA()>0){
                                 if($config->BONUS_PWA()>0){
-                                    OuroGameService::AddScore($user->UserID,$config->BONUS_PWA(),OuroGameService::REASON_PwaBonus,false);
+                                    OuroGameService::AddFreeScore($user->UserID,$config->BONUS_PWA(),OuroGameService::REASON_PwaBonus,false);
                                 }
                                 }
                             }
                             }
                         }
                         }

+ 52 - 0
app/Http/Controllers/Game/RewardCodeController.php

@@ -0,0 +1,52 @@
+<?php
+
+namespace App\Http\Controllers\Game;
+
+use App\Game\GlobalUserInfo;
+use App\Http\Controllers\Controller;
+use App\Services\RewardCodeService;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
+
+class RewardCodeController extends Controller
+{
+    /**
+     * Redeem reward code (4 chars).
+     */
+    public function redeem(Request $request)
+    {
+        $code = strtoupper(trim($request->input('code', '')));
+
+        if (strlen($code) !== 4 || !preg_match('/^[A-Z0-9]{4}$/', $code)) {
+            return apiReturnFail('invalid_code');
+        }
+
+        // only allow logged-in users
+        $user = $request->user();
+        if (!$user) {
+            return apiReturnFail('login_required');
+        }
+        $UserID = $user->UserID;
+        $GlobalUID = $user->GlobalUID;
+
+        $lockKey = 'reward_code_redeem_' . $UserID;
+        $locked = \App\Utility\SetNXLock::getExclusiveLock($lockKey, 5);
+        if (!$locked) {
+            return apiReturnFail('try_again_later');
+        }
+
+        try {
+            $data = RewardCodeService::redeem($code, $GlobalUID, $request->ip(), $UserID);
+            return apiReturnSuc($data, '', 'success');
+        } catch (\InvalidArgumentException $e) {
+            $msg = $e->getMessage();
+            return apiReturnFail($msg);
+        } catch (\Throwable $e) {
+            Log::error('Reward code redeem error: ' . $e->getMessage(), ['trace' => $e->getTraceAsString()]);
+            return apiReturnFail('system_error');
+        } finally {
+            \App\Utility\SetNXLock::release($lockKey);
+        }
+    }
+}
+

+ 38 - 0
app/Models/RewardCode.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class RewardCode extends Model
+{
+    // Refer to Order model: use write connection and table agent.dbo.reward_codes
+    protected $connection = 'write';
+
+    protected $table = 'agent.dbo.reward_codes';
+
+    protected $fillable = [
+        'code',
+        'expire_at',
+        'total_amount',
+        'min_amount',
+        'max_amount',
+        'total_count',
+        'claimed_count',
+        'claimed_amount',
+        'status',
+        'remark',
+    ];
+
+    protected $casts = [
+        'expire_at' => 'datetime',
+        'total_amount' => 'float',
+        'min_amount' => 'float',
+        'max_amount' => 'float',
+        'total_count' => 'integer',
+        'claimed_count' => 'integer',
+        'claimed_amount' => 'float',
+        'status' => 'integer',
+    ];
+}
+

+ 27 - 0
app/Models/RewardCodeClaim.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class RewardCodeClaim extends Model
+{
+    // Refer to Order model: use write connection and table agent.dbo.reward_code_claims
+    protected $connection = 'write';
+
+    protected $table = 'agent.dbo.reward_code_claims';
+
+    protected $fillable = [
+        'reward_code_id',
+        'code',
+        'UserID',
+        'GlobalUID',
+        'amount',
+        'client_ip',
+    ];
+
+    protected $casts = [
+        'amount' => 'float',
+    ];
+}
+

+ 113 - 0
app/Services/RewardCodeService.php

@@ -0,0 +1,113 @@
+<?php
+
+namespace App\Services;
+
+use App\Game\GlobalUserInfo;
+use App\Game\Services\OuroGameService;
+use App\Http\helper\NumConfig;
+use App\Models\RewardCode;
+use App\Models\RewardCodeClaim;
+use Carbon\Carbon;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Str;
+
+class RewardCodeService
+{
+    const STATUS_ACTIVE = 1;
+    const STATUS_INACTIVE = 0;
+
+    /**
+     * Generate a unique 4-char alphanumeric reward code.
+     */
+    public static function generateUniqueCode(int $maxRetry = 5): string
+    {
+        for ($i = 0; $i < $maxRetry; $i++) {
+            $code = strtoupper(Str::random(4));
+            if (!RewardCode::where('code', $code)->exists()) {
+                return $code;
+            }
+        }
+        throw new \RuntimeException('Failed to generate unique reward code');
+    }
+
+    /**
+     * Redeem reward by code.
+     */
+    public static function redeem(string $code, string $GlobalUID, string $clientIp = '', int $UserID = 0): array
+    {
+        $code = strtoupper($code);
+        $now = Carbon::now();
+        if (!$UserID) {
+            $user = GlobalUserInfo::getGameUserInfo('GlobalUID', $GlobalUID);
+            if (!$user) {
+                throw new \InvalidArgumentException('user_not_exist');
+            }
+            $UserID = $user->UserID;
+        }
+
+        return DB::connection('write')->transaction(function () use ($code, $UserID, $GlobalUID, $clientIp, $now) {
+            $rewardCode = RewardCode::where('code', $code)->lockForUpdate()->first();
+            if (!$rewardCode || $rewardCode->status != self::STATUS_ACTIVE) {
+                throw new \InvalidArgumentException('code_not_found');
+            }
+            if ($rewardCode->expire_at && $now->gt(Carbon::parse($rewardCode->expire_at))) {
+                throw new \InvalidArgumentException('code_expired');
+            }
+            if ($rewardCode->claimed_count >= $rewardCode->total_count) {
+                throw new \InvalidArgumentException('code_limit_reached');
+            }
+            if ($rewardCode->claimed_amount >= $rewardCode->total_amount) {
+                throw new \InvalidArgumentException('code_amount_exhausted');
+            }
+            if (RewardCodeClaim::where('reward_code_id', $rewardCode->id)->where('UserID', $UserID)->exists()) {
+                throw new \InvalidArgumentException('already_claimed');
+            }
+
+            $remainingCount = $rewardCode->total_count - $rewardCode->claimed_count;
+            $remainingAmount = $rewardCode->total_amount - $rewardCode->claimed_amount;
+
+            if ($remainingAmount < $rewardCode->min_amount) {
+                throw new \InvalidArgumentException('code_amount_exhausted');
+            }
+
+            // fixed-point to support decimals (<1)
+            $scale = 100;
+            $min = (int)round($rewardCode->min_amount * $scale);
+            $max = (int)round($rewardCode->max_amount * $scale);
+            $remainingScaled = (int)floor($remainingAmount * $scale);
+
+            $minReserve = ($remainingCount - 1) * $min;
+            $maxPossible = $remainingScaled - $minReserve;
+            $maxPossible = max($min, min($max, $maxPossible));
+            $reward = mt_rand($min, $maxPossible) / $scale;
+            $reward = round($reward, 2);
+
+            $rewardCode->claimed_count += 1;
+            $rewardCode->claimed_amount = round($rewardCode->claimed_amount + $reward, 2);
+            $rewardCode->save();
+
+            RewardCodeClaim::create([
+                'reward_code_id' => $rewardCode->id,
+                'code' => $rewardCode->code,
+                'UserID' => $UserID,
+                'GlobalUID' => $GlobalUID,
+                'amount' => $reward,
+                'client_ip' => $clientIp,
+            ]);
+
+            $scoreAmount = (int)round($reward * NumConfig::NUM_VALUE);
+            OuroGameService::AddScore($UserID, $scoreAmount, OuroGameService::REASON_RewardCode,false);
+
+            return [
+                'code' => $rewardCode->code,
+                'amount' => $reward,
+                'claimed_count' => $rewardCode->claimed_count,
+                'claimed_amount' => $rewardCode->claimed_amount,
+                'total_count' => $rewardCode->total_count,
+                'total_amount' => $rewardCode->total_amount,
+                'expire_at' => $rewardCode->expire_at,
+            ];
+        });
+    }
+}
+

+ 100 - 0
resources/views/admin/reward_code/history.blade.php

@@ -0,0 +1,100 @@
+@extends('base.base')
+@section('base')
+<div class="main-panel">
+    <div class="content-wrapper">
+        <div class="page-header">
+            <h3 class="page-title">
+                <span class="page-title-icon bg-gradient-primary text-white mr-2">
+                    <i class="mdi mdi-history"></i>
+                </span>
+                Reward Code Claim Records
+            </h3>
+        </div>
+
+        <div class="row mb-3">
+            <div class="col-12 grid-margin stretch-card">
+                <div class="card">
+                    <div class="card-body">
+                        <form class="form-inline" id="search-form" method="get" action="">
+                            <div class="form-group mr-3">
+                                <label class="mr-2">Code</label>
+                                <input type="text" class="form-control" name="code" value="{{ $code ?? '' }}" placeholder="Filter by Code">
+                            </div>
+                            <div class="form-group mr-3">
+                                <label class="mr-2">UserID</label>
+                                <input type="text" class="form-control" name="user_id" value="{{ $user_id ?? '' }}" placeholder="Filter by UserID">
+                            </div>
+                            <div class="form-group mr-3">
+                                <label class="mr-2">GameID</label>
+                                <input type="text" class="form-control" name="game_id" value="{{ $game_id ?? '' }}" placeholder="Filter by GameID">
+                            </div>
+                            <div class="form-group mr-3">
+                                <label class="mr-2">Start Date</label>
+                                <input type="date" class="form-control" name="start_date" value="{{ $start_date ?? '' }}">
+                            </div>
+                            <div class="form-group mr-3">
+                                <label class="mr-2">End Date</label>
+                                <input type="date" class="form-control" name="end_date" value="{{ $end_date ?? '' }}">
+                            </div>
+                            <button type="submit" class="btn btn-sm btn-gradient-primary mr-2">Search</button>
+                            <button type="button" class="btn btn-sm btn-gradient-warning" onclick="resetSearch()">Reset</button>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <div class="row">
+            <div class="col-lg-12 grid-margin stretch-card">
+                <div class="card">
+                    <div class="card-body">
+                        <h4 class="card-title">Claim Records List</h4>
+                        <div class="table-responsive">
+                            <table class="table table-bordered">
+                                <thead>
+                                <tr>
+                                    <th>ID</th>
+                                    <th>Code</th>
+                                    <th>UserID</th>
+                                    <th>GameID</th>
+                                    <th>NickName</th>
+                                    <th>Amount</th>
+                                    <th>Client IP</th>
+                                    <th>Created At</th>
+                                </tr>
+                                </thead>
+                                <tbody>
+                                @forelse($list as $item)
+                                    <tr>
+                                        <td>{{ $item->id }}</td>
+                                        <td><strong>{{ $item->code }}</strong></td>
+                                        <td>{{ $item->UserID }}</td>
+                                        <td>{{ $item->GameID }}</td>
+                                        <td>{{ $item->NickName }}</td>
+                                        <td>{{ number_format($item->amount, 2) }}</td>
+                                        <td>{{ $item->client_ip }}</td>
+                                        <td>{{ $item->created_at }}</td>
+                                    </tr>
+                                @empty
+                                    <tr>
+                                        <td colspan="8" class="text-center text-muted">No records found</td>
+                                    </tr>
+                                @endforelse
+                                </tbody>
+                            </table>
+                        </div>
+                        <div class="mt-3">
+                            {{ $list->appends(request()->all())->links() }}
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+    function resetSearch() {
+        window.location.href = window.location.pathname;
+    }
+</script>
+@endsection

+ 136 - 0
resources/views/admin/reward_code/index.blade.php

@@ -0,0 +1,136 @@
+@extends('base.base')
+
+@section('base')
+<div class="main-panel">
+    <div class="content-wrapper">
+        <div class="page-header">
+            <h3 class="page-title">
+                <span class="page-title-icon bg-gradient-primary text-white mr-2">
+                    <i class="mdi mdi-tag-text-outline"></i>
+                </span>
+                Reward Code Management
+            </h3>
+        </div>
+
+        <form class="form-inline mb-3" method="get" action="">
+            <div class="form-group mr-2">
+                <label class="mr-1">Code</label>
+                <input type="text" name="code" class="form-control" value="{{ $code ?? '' }}" placeholder="e.g. AB12">
+            </div>
+            <div class="form-group mr-2">
+                <label class="mr-1">Status</label>
+                <select name="status" class="form-control">
+                    <option value="">All</option>
+                    <option value="1" @if($status==='1') selected @endif>Enabled</option>
+                    <option value="0" @if($status==='0') selected @endif>Disabled</option>
+                </select>
+            </div>
+            <div class="form-group mr-2">
+                <label class="mr-1">Expired</label>
+                <select name="expired" class="form-control">
+                    <option value="">All</option>
+                    <option value="0" @if($expired==='0') selected @endif>Active</option>
+                    <option value="1" @if($expired==='1') selected @endif>Expired</option>
+                </select>
+            </div>
+            <button type="submit" class="btn btn-primary">Search</button>
+        </form>
+
+        @if(session('success'))
+            <div class="alert alert-success">{{ session('success') }}</div>
+        @endif
+
+        <div class="card mb-4">
+            <div class="card-header">Create Reward Code</div>
+            <div class="card-body">
+                <form method="post" action="/admin/reward-code">
+                    @csrf
+                    <div class="form-row">
+                        <div class="form-group col-md-2">
+                            <label>Total Amount</label>
+                            <input type="number" name="total_amount" class="form-control" min="0.01" step="0.01" required>
+                        </div>
+                        <div class="form-group col-md-2">
+                            <label>Min Amount</label>
+                            <input type="number" name="min_amount" class="form-control" min="0.01" step="0.01" required>
+                        </div>
+                        <div class="form-group col-md-2">
+                            <label>Max Amount</label>
+                            <input type="number" name="max_amount" class="form-control" min="0.01" step="0.01" required>
+                        </div>
+                        <div class="form-group col-md-2">
+                            <label>Total Count</label>
+                            <input type="number" name="total_count" class="form-control" min="1" required>
+                        </div>
+                        <div class="form-group col-md-2">
+                            <label>Expire At</label>
+                            <input type="datetime-local" name="expire_at" class="form-control">
+                        </div>
+                    </div>
+                    <div class="form-row">
+                        <div class="form-group col-md-12">
+                            <label>Remark</label>
+                            <input type="text" name="remark" class="form-control" maxlength="255">
+                        </div>
+                    </div>
+                    <button type="submit" class="btn btn-success">Create One Code</button>
+                    <small class="text-muted ml-2">Total amount must be >= min * total count; min <= max.</small>
+                </form>
+            </div>
+        </div>
+
+        <div class="card">
+            <div class="card-header">Reward Code List</div>
+            <div class="card-body table-responsive">
+                <table class="table table-bordered table-sm">
+                    <thead>
+                    <tr>
+                        <th>ID</th>
+                        <th>Code</th>
+                        <th>Status</th>
+                        <th>Expire At</th>
+                        <th>Total Amount</th>
+                        <th>Claimed Amount</th>
+                        <th>Total Count</th>
+                        <th>Claimed Count</th>
+                        <th>Min</th>
+                        <th>Max</th>
+                        <th>Remark</th>
+                        <th>Created At</th>
+                        <th>Action</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    @foreach($list as $item)
+                        <tr>
+                            <td>{{ $item->id }}</td>
+                            <td><strong><a href="/admin/reward-code/history?code={{ $item->code }}" class="text-primary">{{ $item->code }}</a></strong></td>
+                            <td>{{ $item->status ? 'Enabled' : 'Disabled' }}</td>
+                            <td>{{ $item->expire_at }}</td>
+                            <td>{{ $item->total_amount }}</td>
+                            <td>{{ $item->claimed_amount }}</td>
+                            <td>{{ $item->total_count }}</td>
+                            <td>{{ $item->claimed_count }}</td>
+                            <td>{{ $item->min_amount }}</td>
+                            <td>{{ $item->max_amount }}</td>
+                            <td>{{ $item->remark }}</td>
+                            <td>{{ $item->created_at }}</td>
+                            <td>
+                                <form method="post" action="/admin/reward-code/{{ $item->id }}/status" style="display:inline-block;">
+                                    @csrf
+                                    <input type="hidden" name="status" value="{{ $item->status ? 0 : 1 }}">
+                                    <button type="submit" class="btn btn-sm {{ $item->status ? 'btn-warning' : 'btn-success' }}">
+                                        {{ $item->status ? 'Disable' : 'Enable' }}
+                                    </button>
+                                </form>
+                            </td>
+                        </tr>
+                    @endforeach
+                    </tbody>
+                </table>
+                {{ $list->links() }}
+            </div>
+        </div>
+    </div>
+</div>
+@endsection

+ 2 - 0
routes/game.php

@@ -246,6 +246,8 @@ Route::group([
     $route->any('/pay/claim_first_pay_gift', 'Game\PayRechargeController@claimFirstPayGiftReward'); // 领取首充礼包奖励
     $route->any('/pay/claim_first_pay_gift', 'Game\PayRechargeController@claimFirstPayGiftReward'); // 领取首充礼包奖励
     $route->any('/pay/bankruptcy_gift', 'Game\PayRechargeController@bankruptcyGift'); // 破产礼包
     $route->any('/pay/bankruptcy_gift', 'Game\PayRechargeController@bankruptcyGift'); // 破产礼包
 
 
+    $route->any('/reward-code/redeem', 'Game\RewardCodeController@redeem');
+
     //正式
     //正式
     $route->any('/pgpro/lunch', 'Game\PgSoftController@gameLunch');
     $route->any('/pgpro/lunch', 'Game\PgSoftController@gameLunch');
 
 

+ 6 - 0
routes/web.php

@@ -195,6 +195,12 @@ Route::group([
         $route->get('/exchange/revenueinfo', 'Admin\ExchangeController@revenueInfo');
         $route->get('/exchange/revenueinfo', 'Admin\ExchangeController@revenueInfo');
         $route->get('/exchange/cost', 'Admin\ExchangeController@costList');
         $route->get('/exchange/cost', 'Admin\ExchangeController@costList');
         $route->post('/cost/update/{id}', 'Admin\ExchangeController@costUpdate');
         $route->post('/cost/update/{id}', 'Admin\ExchangeController@costUpdate');
+
+        // Reward code admin
+        $route->get('/reward-code', 'Admin\RewardCodeController@index');
+        $route->post('/reward-code', 'Admin\RewardCodeController@store');
+        $route->post('/reward-code/{id}/status', 'Admin\RewardCodeController@updateStatus');
+        $route->get('/reward-code/history', 'Admin\RewardCodeController@records');
         //充值管理
         //充值管理
         $route->get('/recharge/config/cash', 'Admin\WithdrawalController@cashier_channel_config')->name('admin.cashier.config');
         $route->get('/recharge/config/cash', 'Admin\WithdrawalController@cashier_channel_config')->name('admin.cashier.config');
         $route->get('/recharge/list/{history?}', 'Admin\RechargeController@rechargeList');
         $route->get('/recharge/list/{history?}', 'Admin\RechargeController@rechargeList');