Browse Source

培训意愿

linwu 3 năm trước cách đây
mục cha
commit
6d719431a4
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      app/mainapp/controller/Train.php

+ 5 - 0
app/mainapp/controller/Train.php

@@ -52,6 +52,11 @@ class Train extends BaseController
             page_result(1, "信息不存在");
         }
 
+        $check = TrainJoinModel::where('train_id',$train_id)->where('user_id',$userid)->find();
+        if (!empty($check)) {
+            page_result(1, "请勿重复报名");
+        }
+
         TrainJoinModel::create([
             'train_id'    => $train_id,
             'user_id'     => $userid,