allen 3 years ago
parent
commit
29e3f2a665
1 changed files with 8 additions and 5 deletions
  1. 8 5
      app/index/controller/Index.php

+ 8 - 5
app/index/controller/Index.php

@@ -349,11 +349,6 @@ class Index extends Controller
      */
      */
     public function submitReceive()
     public function submitReceive()
     {
     {
-        $activity = Db::table('awards_activity')->where('begin_at', '<=', time())
-            ->where('end_at', '>=', time())->find();
-        if (empty($activity)) {
-            return $this->response(5002, '活动末开始');
-        }
 
 
         $name = trim(Request::post("name"));
         $name = trim(Request::post("name"));
         $mobile = trim(Request::post("mobile"));
         $mobile = trim(Request::post("mobile"));
@@ -361,6 +356,14 @@ class Index extends Controller
         $giftId = trim(Request::post("giftId"));
         $giftId = trim(Request::post("giftId"));
         $type = trim(Request::post("type"));
         $type = trim(Request::post("type"));
 
 
+        if ($type == 1) {
+            $activity = Db::table('awards_activity')->where('begin_at', '<=', time())
+                ->where('end_at', '>=', time())->find();
+            if (empty($activity)) {
+                return $this->response(5002, '活动末开始');
+            }
+        }
+
         $orders = Db::table('awards_order')->where('uid', Safe::$user['uid'])->where('type', $type)->find();
         $orders = Db::table('awards_order')->where('uid', Safe::$user['uid'])->where('type', $type)->find();
         if (empty($orders)) {
         if (empty($orders)) {
             return $this->response(5001, '参数有误');
             return $this->response(5001, '参数有误');