linwu 1 year ago
parent
commit
95cacd741e
1 changed files with 10 additions and 0 deletions
  1. 10 0
      app/mainapp/controller/Activity.php

+ 10 - 0
app/mainapp/controller/Activity.php

@@ -51,6 +51,16 @@ class Activity extends BaseController
         if ($info->isEmpty()) {
             page_result(1, "活动不存在");
         }
+
+        $join = ActivityJoinModel::where([
+            ['user_id','=',$userid],
+            ['activity_id','=',$id],
+            ['status','=',1],
+        ])->find();
+        if (!empty($join)) {
+            page_result(1, "请勿重复参加");
+        }
+
         $info->join_num++;
         $info->save();