|
@@ -7,6 +7,7 @@ use App\Models\ActivityReward as ActivityRewardModel;
|
|
|
use App\Models\ActivityUser;
|
|
use App\Models\ActivityUser;
|
|
|
use App\Services\ActivityRewardService;
|
|
use App\Services\ActivityRewardService;
|
|
|
use App\Services\ActivityUserService;
|
|
use App\Services\ActivityUserService;
|
|
|
|
|
+use App\Services\UserService;
|
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
use Illuminate\Validation\ValidationException;
|
|
use Illuminate\Validation\ValidationException;
|
|
|
use Exception;
|
|
use Exception;
|
|
@@ -32,6 +33,10 @@ class ActivityReward extends BaseController
|
|
|
if (ActivityUser::where('member_id', $memberId)->where('activity_id', $activityId)->exists()) {
|
|
if (ActivityUser::where('member_id', $memberId)->where('activity_id', $activityId)->exists()) {
|
|
|
throw new Exception('已参与过此活动,每个活动仅可参加一次', HttpStatus::CUSTOM_ERROR);
|
|
throw new Exception('已参与过此活动,每个活动仅可参加一次', HttpStatus::CUSTOM_ERROR);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ $user = UserService::findOne(['member_id' => $memberId]);
|
|
|
|
|
+ if(empty($user->phone)) throw new Exception('请先绑定手机号', HttpStatus::NOT_BIND_PHONE);
|
|
|
|
|
+
|
|
|
$time = time();
|
|
$time = time();
|
|
|
$activity = ActivityRewardService::findOne([
|
|
$activity = ActivityRewardService::findOne([
|
|
|
'start_time' => ['<=', $time],
|
|
'start_time' => ['<=', $time],
|