Browse Source

修复发证错误

sugangqiang 1 year ago
parent
commit
3b931f96e7
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/admin/controller/Talent.php

+ 3 - 1
app/admin/controller/Talent.php

@@ -774,9 +774,11 @@ class Talent extends AdminController {
             $talent_max_no = [];
             $user = $this->user;
             $_prefix_type = "";
+            $subindex = 5;
             switch ($user["type"]) {
                 case 2:
                     $_prefix_type = "IC";
+                    $subindex += strlen($_prefix_type);
                     break;
             }
             try {
@@ -795,7 +797,7 @@ class Talent extends AdminController {
                     if (!$max_no) {
                         $max_no = $no_prefix . "0001";
                     } else {
-                        $new_no = intval(substr($max_no, 5)) + 1;
+                        $new_no = intval(substr($max_no, $subindex)) + 1;
                         $max_no = $no_prefix . str_pad($new_no, 4, "0", STR_PAD_LEFT);
                     }
 //更新证书编号