@@ -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;
// 中奖上限以后不再中奖
@@ -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()]];
}
$rewarTotal = $data['max_reward'] ? $RiddleRecord->query()->where(['lottery_id'=>$data['id'],'custom_uid'=>$uid])->where($map)->count() : 0;