Kirin 1 år sedan
förälder
incheckning
dac5abc268
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3 3
      app/models/user/Cert.php

+ 3 - 3
app/models/user/Cert.php

@@ -107,7 +107,7 @@ class Cert extends BaseModel
 //        if ($info['status'] != 0) return self::setErrorInfo('记录已处理');
 //        if ($info['status'] != 0) return self::setErrorInfo('记录已处理');
         if (!$info['code'] && $data['status'] == 1) {
         if (!$info['code'] && $data['status'] == 1) {
             $date = date('Y-m-d');
             $date = date('Y-m-d');
-            $code = self::createNewCode($info, $info['level']);
+            $code = self::createNewCode($data);
             $data['date'] = $date;
             $data['date'] = $date;
             $data['code'] = $code;
             $data['code'] = $code;
             if (!$info['qrcode']) {
             if (!$info['qrcode']) {
@@ -130,11 +130,11 @@ class Cert extends BaseModel
         return $res;
         return $res;
     }
     }
 
 
-    public static function createNewCode($info, $level)
+    public static function createNewCode($info)
     {
     {
         $str = CertType::where('cert_name', $info['job'])->value('cert_code');
         $str = CertType::where('cert_name', $info['job'])->value('cert_code');
         if (!$str) $str = 'UK';
         if (!$str) $str = 'UK';
-        $str .= ($level == 4 ? '特' : ('0' . $level));
+        $str .= ($info['level'] == 4 ? '特' : ('0' . $info['level']));
         $str .= '-021-' . substr($info['idcard'], strlen($info['idcard']) - 4, 4);
         $str .= '-021-' . substr($info['idcard'], strlen($info['idcard']) - 4, 4);
         $str .= '-' . str_pad((self::where('status', 1)->count() + 1), 4, 0, STR_PAD_LEFT);
         $str .= '-' . str_pad((self::where('status', 1)->count() + 1), 4, 0, STR_PAD_LEFT);
 //        do {
 //        do {