Browse Source

活动时间判定

linwu 1 năm trước cách đây
mục cha
commit
64bd90f3d9
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      app/mobile/controller/Vote.php

+ 8 - 0
app/mobile/controller/Vote.php

@@ -54,6 +54,14 @@ class Vote extends MobileBaseController
             ajax_return(1, '该选项不存在,请重新选择');
         }
 
+        $time = time();
+        if ($time < strtotime($vote['start_time'])) {
+            ajax_return(1, '活动未开始');
+        }
+        if ($time > strtotime($vote['end_time'])) {
+            ajax_return(1, '活动已结束');
+        }
+
         if (request()->ip() != '192.168.1.1') {
             ajax_return(1, '请连接RCG的WIFI进行投票');
         }