Browse Source

2023-5-22-1 新增服务区

yingzi 2 years ago
parent
commit
20574b769f
1 changed files with 5 additions and 5 deletions
  1. 5 5
      app/api/controller/User.php

+ 5 - 5
app/api/controller/User.php

@@ -407,14 +407,14 @@ class User extends BaseController
         }
 
         //生成编码
-        $r = (new InfoAudit)->insertGetId($save);
-        if(!$r){
-            return app('json')->fail("系统错误");
-        }
-        $exist = (new InfoAudit)->where('uid', $save['uid'])->find();
+        $exist = (new InfoAudit)->where('uid', $save['uid'])->where('status', '<>', 2)->find();
         if($exist && !empty($exist['no'])){
             $no = $exist['no'];
         }else{
+            $r = (new InfoAudit)->insertGetId($save);
+            if(!$r){
+                return app('json')->fail("系统错误");
+            }
             $id = str_pad($r, 6, "0", STR_PAD_LEFT);
             $no = "MYJ".date("Ymd").$id;
             (new InfoAudit)->where("id",$r)->update(["no"=>$no]);