|
@@ -26,12 +26,13 @@ class ActivityReward extends BaseController
|
|
|
public function rule(): JsonResponse
|
|
public function rule(): JsonResponse
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
- $activityRole =ConfigService::getVal("activity_rule");
|
|
|
|
|
- }catch (Exception $e){
|
|
|
|
|
|
|
+ $activityRole = ConfigService::getVal("activity_rule");
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
return $this->error($e->getMessage(), [], $e->getCode());
|
|
return $this->error($e->getMessage(), [], $e->getCode());
|
|
|
}
|
|
}
|
|
|
return $this->success($activityRole);
|
|
return $this->success($activityRole);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//验证手机号
|
|
//验证手机号
|
|
|
public function verifyPhone(): JsonResponse
|
|
public function verifyPhone(): JsonResponse
|
|
|
{
|
|
{
|
|
@@ -106,12 +107,15 @@ class ActivityReward extends BaseController
|
|
|
|
|
|
|
|
$time = time();
|
|
$time = time();
|
|
|
$activity = ActivityRewardService::findOne([
|
|
$activity = ActivityRewardService::findOne([
|
|
|
- 'start_time' => ['<=', $time],
|
|
|
|
|
- 'end_time' => ['>=', $time],
|
|
|
|
|
|
|
+// 'start_time' => ['<=', $time],
|
|
|
|
|
+// 'end_time' => ['>=', $time],
|
|
|
'status' => ActivityRewardModel::STATUS_UP,
|
|
'status' => ActivityRewardModel::STATUS_UP,
|
|
|
'id' => $activityId
|
|
'id' => $activityId
|
|
|
]);
|
|
]);
|
|
|
- if (!$activity) throw new Exception('活动不存在或不在活动时间内', HttpStatus::CUSTOM_ERROR);
|
|
|
|
|
|
|
+ if (!$activity) throw new Exception('活动不存在', HttpStatus::CUSTOM_ERROR);
|
|
|
|
|
+ if ($activity->start_time > $time) throw new Exception('活动未开始', HttpStatus::CUSTOM_ERROR);
|
|
|
|
|
+ if ($activity->end_time < $time) throw new Exception('活动已结束', HttpStatus::CUSTOM_ERROR);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
ActivityUserService::submit([
|
|
ActivityUserService::submit([
|
|
|
'activity_id' => $activityId,
|
|
'activity_id' => $activityId,
|