Эх сурвалжийг харах

【Add】积分抽奖增加时间验证

liuxiangxin 2 сар өмнө
parent
commit
2a311fefb1

+ 4 - 0
app/Http/Controllers/Api/Lottery/Score.php

@@ -39,6 +39,10 @@ class Score extends Api{
 		$data			                = $Model->getOneByCity($cityId);
 		// 如果存在的话
 		if( !$data )					return json_send(['code'=>'error','msg'=>'暂无活动','data'=>$data]);
+		// 活动时间判断
+		if( $data['start_time'] > time() ) return json_send(['code'=>'error','msg'=>'活动暂未开始','data'=>$data]);
+		// 活动时间判断
+		if( $data['end_time'] < time() ) return json_send(['code'=>'error','msg'=>'活动已结束','data'=>$data]);
 		// 奖品
 		$reward 						= $ScoreReward->getListByLottery($data['id']);
 		// 活动暂无奖品