|
|
@@ -95,15 +95,15 @@ class ActivityReward extends BaseController
|
|
|
$user = UserService::findOne(['member_id' => $memberId]);
|
|
|
if (empty($user->phone)) throw new Exception('请先绑定手机号', HttpStatus::NOT_BIND_PHONE);
|
|
|
|
|
|
- if (ActivityUser::where('member_id', $memberId)->where('status', 0)->exists()) {
|
|
|
- throw new Exception('您有正在进行的活动,不可同时参与多个活动', HttpStatus::CUSTOM_ERROR);
|
|
|
- }
|
|
|
- $activityId = request()->input('activity_id');
|
|
|
|
|
|
+ $activityId = request()->input('activity_id');
|
|
|
if (ActivityUser::where('member_id', $memberId)->where('activity_id', $activityId)->exists()) {
|
|
|
throw new Exception('已参与过此活动,每个活动仅可参加一次', HttpStatus::CUSTOM_ERROR);
|
|
|
}
|
|
|
|
|
|
+ if (ActivityUser::where('member_id', $memberId)->whereIn('status', [ActivityUser::STATUS_APPLY,ActivityUser::STATUS_IN_PROGRESS])->exists()) {
|
|
|
+ throw new Exception('您有正在进行的活动,不可同时参与多个活动', HttpStatus::CUSTOM_ERROR);
|
|
|
+ }
|
|
|
|
|
|
$time = time();
|
|
|
$activity = ActivityRewardService::findOne([
|