<?php

namespace App\Http\Controllers\Gteam;

use App\Http\Controllers\Miniprogram\Auth;
use App\Http\Resources\Gteam\ActivityResource;
use App\Models\Gteam\ActivityModel;
use App\Models\Gteam\EnterModel;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class ActivityController extends Controller
{
    //


    public function show(Request $request, $id)
    {
        $uid = Auth::auth();
        $activity = ActivityModel::findOrFail($id);
        $activity->enter = EnterModel::where(['activity_id' => $activity->id, 'uid' => $uid])->first();
        return new ActivityResource($activity);
    }
}
