diff --git a/application/common/service/RedpacketService.php b/application/common/service/RedpacketService.php index dea1189f..57a343fd 100644 --- a/application/common/service/RedpacketService.php +++ b/application/common/service/RedpacketService.php @@ -187,6 +187,15 @@ class RedpacketService unset($grabResult['all_records']);//前端不要 unset($grabResult['statistics']);//前端不要 + //处理任务 + //查询今日是否抢到5个红包 + $tady_red_num = Db::name('redpacket_record') + ->where('user_id',$userId) + ->where('createtime', '>=', strtotime(date('Y-m-d'))) + ->count(); + if($tady_red_num >= 5){ + model('api/Tasks')->tasks_complete($userId,36); + } return [ 'code' => 1, 'msg' => '抢红包成功',