Browse Source

修改保存未提交状态如果未曾提交过,过了申报截止日期将不能再提交

sugangqiang 2 năm trước cách đây
mục cha
commit
bae74226ab

+ 2 - 0
app/common/api/BatchApi.php

@@ -180,6 +180,8 @@ class BatchApi {
                 return ["msg" => "不存在该申报批次"];
             if (strtotime($batch["startTime"]) > $now)
                 return ["msg" => sprintf("申报还未开始,日期为:%s - %s", $batch["startTime"], $batch["endTime"])];
+            if (strtotime($batch["endTime"]) < $now && !$params["first_submit_time"])
+                return ["msg" => "申报已结束,无法申报"];
             if ($batch["submitEndTime"] && strtotime($batch["submitEndTime"]) < $now)
                 return ["msg" => "提交时间已截止,无法操作"];
         } else {

+ 1 - 1
app/enterprise/controller/Integral.php

@@ -168,7 +168,7 @@ class Integral extends EnterpriseController {
     private function save($info, \think\Request $request, $checkState) {
         try {
             $param = $request->param();
-            $batch = BatchApi::checkBatchValid(["type" => ProjectState::INTEGRAL, "year" => $info["apply_year"]], $this->user["type"]);
+            $batch = BatchApi::checkBatchValid(["type" => ProjectState::INTEGRAL, "year" => $info["apply_year"], "first_submit_time" => $info["first_submit_time"]], $this->user["type"]);
             if ($batch["code"] != 200) {
                 throw new ValidateException($batch["msg"]);
             }

+ 3 - 3
app/enterprise/controller/Talent.php

@@ -514,7 +514,7 @@ class Talent extends EnterpriseController {
      */
     private function save($info, \think\Request $request, $checkState) {
         try {
-            $batch = BatchApi::checkBatchValid(["type" => ProjectState::TALENT, "year" => $info["apply_year"]], $this->user["type"]);
+            $batch = BatchApi::checkBatchValid(["type" => ProjectState::TALENT, "year" => $info["apply_year"], "first_submit_time" => $info["first_submit_time"]], $this->user["type"]);
             if ($batch["code"] != 200) {
                 throw new ValidateException($batch["msg"]);
             }
@@ -618,7 +618,7 @@ class Talent extends EnterpriseController {
      */
     private function mixSave($info, \think\Request $request, $checkState) {
         try {
-            $batch = BatchApi::checkBatchValid(["type" => ProjectState::TALENT, "year" => $info["apply_year"]], $this->user["type"]);
+            $batch = BatchApi::checkBatchValid(["type" => ProjectState::TALENT, "year" => $info["apply_year"], "first_submit_time" => $info["first_submit_time"]], $this->user["type"]);
             if ($batch["code"] != 200) {
                 throw new ValidateException($batch["msg"]);
             }
@@ -879,7 +879,7 @@ class Talent extends EnterpriseController {
 
     private function icSave($info, \think\Request $request, $checkState) {
         try {
-            $batch = BatchApi::checkBatchValid(["type" => ProjectState::TALENT, "year" => $info["apply_year"]], $this->user["type"]);
+            $batch = BatchApi::checkBatchValid(["type" => ProjectState::TALENT, "year" => $info["apply_year"], "first_submit_time" => $info["first_submit_time"]], $this->user["type"]);
             if ($batch["code"] != 200) {
                 throw new ValidateException($batch["msg"]);
             }

+ 1 - 0
public/static/modular/gate/integral/integral.js

@@ -251,6 +251,7 @@ Integral.editInfo = function () {
         });
         ajax.set("type", CONFIG.project_integral_apply);
         ajax.set("year", Integral.seItem.apply_year);
+        ajax.set("first_submit_time", TalentInfo.seItem.first_submit_time);
         ajax.start();
     }
 };

+ 1 - 0
public/static/modular/gate/talentInfo/new_talentInfo.js

@@ -294,6 +294,7 @@ TalentInfo.editTalentInfo = function () {
         });
         ajax.set("type", CONFIG.project_rcrd);
         ajax.set("year", TalentInfo.seItem.apply_year);
+        ajax.set("first_submit_time", TalentInfo.seItem.first_submit_time);
         ajax.start();
     }
 };