Browse Source

【Fix】修复最多中奖次数只有1次的问题

liuxiangxin 2 months ago
parent
commit
de45cef122

+ 0 - 2
app/Http/Controllers/Api/Lottery/Recruitment.php

@@ -170,8 +170,6 @@ class Recruitment extends Api{
 		// 开启事务
 		DB::beginTransaction();
 		try{
-			// 是否限制中奖次数字段,没有默认中奖一次
-			$data['max_reward']				= isset($data['max_reward']) ? 1 : $data['max_reward'];
 			// 限制中奖则获取中奖次数
 			$rewarTotal						= $data['max_reward'] ? $RecruitmentRecord->query()->where([['lottery_id','=',$data['id']],['custom_uid','=',$uid],['reward_id','>',0]])->where($map)->count() : 0;
 			// 中奖上限以后不再中奖

+ 0 - 2
app/Http/Controllers/Api/Lottery/Riddle.php

@@ -119,8 +119,6 @@ class Riddle extends Api{
 				if( $data['freq'] == 2 )	$map = [['insert_time','>=',now()->startOfWeek()->getTimestamp()],['insert_time','<=',now()->endOfWeek()->getTimestamp()]];
 				if( $data['freq'] == 3 )	$map = [['insert_time','>=',now()->startOfMonth()->getTimestamp()],['insert_time','<=',now()->endOfMonth()->getTimestamp()]];
 			}
-			// 是否限制中奖次数字段,没有默认中奖一次
-			$data['max_reward']				= isset($data['max_reward']) ? 1 : $data['max_reward'];
 			// 限制中奖则获取中奖次数
 			$rewarTotal						= $data['max_reward'] ? $RiddleRecord->query()->where(['lottery_id'=>$data['id'],'custom_uid'=>$uid])->where($map)->count() : 0;
 			// 中奖上限以后不再中奖