소스 검색

Default Changelist

yingzi 2 년 전
부모
커밋
77b8c145b8
1개의 변경된 파일28개의 추가작업 그리고 39개의 파일을 삭제
  1. 28 39
      app/system/controller/Audit.php

+ 28 - 39
app/system/controller/Audit.php

@@ -95,43 +95,41 @@ class Audit extends BaseController
      */
      */
     public function infoAuditSub(Request $request)
     public function infoAuditSub(Request $request)
     {
     {
-        $post = UtilService::getMore([
-            ['id', '', 'empty', '参数错误'],
-            ['mono'],
-            ['type', 0],
-        ], $request);
+        $post   = UtilService::getMore(
+            [
+                ['id', '', 'empty', '参数错误'],
+                ['mono'],
+                ['type', 0],
+            ], $request);
         $certData = (new InfoAudit)->where('id', $post['id'])->find();
         $certData = (new InfoAudit)->where('id', $post['id'])->find();
         if (empty($certData)) {
         if (empty($certData)) {
             return app('json')->fail('数据不存在');
             return app('json')->fail('数据不存在');
         }
         }
-        if ($certData['status'] != 0) {
-            return app('json')->fail('当前审核已处理');
+        if ($certData['status']!=0) {
+            return app('json')->fail( '当前审核已处理');
         }
         }
         //审核通过
         //审核通过
         if ($post['type'] == 1) {
         if ($post['type'] == 1) {
-            //生成注册编号
-            $employeeNumber = 'MYJ' . date('Ymd') . str_pad($certData['id'], 6, '0', STR_PAD_LEFT);
             (new InfoAudit)
             (new InfoAudit)
                 ->where('id', $post['id'])
                 ->where('id', $post['id'])
                 ->save([
                 ->save([
-                    'status'          => 1,
-                    'admin_mono'      => $post['mono'],
-                    'admin_time'      => time(),
-                    'admin_id'        => $request->adminInfo['id'],
-                    'employee_number' => $employeeNumber,
+                    'status'            => 1,
+                    'admin_mono'        => $post['mono'],
+                    'admin_time'        => time(),
+                    'admin_id'          => $request->adminInfo['id'],
                 ]);
                 ]);
             //更新职称
             //更新职称
-            (new UserModel)->where("uid", $certData["uid"])->update(["work_type_id" => $certData["user_work_type_id"]]);
+            (new UserModel)->where("uid",$certData["uid"])->update(["work_type_id"=>$certData["user_work_type_id"]]);
             //绑定初始化模板
             //绑定初始化模板
             (new UserShowTemplate)->userBindTempInit($certData["uid"]);
             (new UserShowTemplate)->userBindTempInit($certData["uid"]);
             //删除以前的资料
             //删除以前的资料
-            (new InfoAudit)->where('uid', $certData['uid'])->where("id", "<>", $certData["id"])->delete();
+            (new InfoAudit)->where('uid', $certData['uid'])->where("id","<>",$certData["id"])->delete();
             return app('json')->success('操作成功');
             return app('json')->success('操作成功');
         }
         }
         //审核驳回
         //审核驳回
         if ($post['type'] == -1) {
         if ($post['type'] == -1) {
-            if (empty($post['mono'])) {
-                return app('json')->fail('请输入驳回理由');
+            if(empty($post['mono'])){
+                return app('json')->fail( '请输入驳回理由');
             }
             }
             (new InfoAudit)
             (new InfoAudit)
                 ->where('id', $post['id'])
                 ->where('id', $post['id'])
@@ -141,8 +139,6 @@ class Audit extends BaseController
                     'admin_time' => time(),
                     'admin_time' => time(),
                     'admin_id'   => $request->adminInfo['id'],
                     'admin_id'   => $request->adminInfo['id'],
                 ]);
                 ]);
-            //删除以前的资料
-            (new InfoAudit)->where('uid', $certData['uid'])->where("id", "<>", $certData["id"])->delete();
             return app('json')->success('已驳回');
             return app('json')->success('已驳回');
         }
         }
     }
     }
@@ -209,21 +205,21 @@ class Audit extends BaseController
      */
      */
     public function typeAuditSub(Request $request)
     public function typeAuditSub(Request $request)
     {
     {
-        $post = UtilService::getMore([
-            ['id', '', 'empty', '参数错误'],
-            ['mono'],
-            ['type', 0],
-        ], $request);
+        $post   = UtilService::getMore(
+            [
+                ['id', '', 'empty', '参数错误'],
+                ['mono'],
+                ['type', 0],
+            ], $request);
         $certData = (new TypeAudit)->where('id', $post['id'])->find();
         $certData = (new TypeAudit)->where('id', $post['id'])->find();
         if (empty($certData)) {
         if (empty($certData)) {
             return app('json')->fail('数据不存在');
             return app('json')->fail('数据不存在');
         }
         }
-        if ($certData['status'] != 0) {
-            return app('json')->fail('当前审核已处理');
+        if ($certData['status']!=0) {
+            return app('json')->fail( '当前审核已处理');
         }
         }
         //审核通过
         //审核通过
         if ($post['type'] == 1) {
         if ($post['type'] == 1) {
-            $employee_number = 'MYJ' . date('Ymd') . str_pad((new TypeAudit)->count() + 100000, 6, '0', STR_PAD_LEFT);
             (new TypeAudit)
             (new TypeAudit)
                 ->where('id', $post['id'])
                 ->where('id', $post['id'])
                 ->save([
                 ->save([
@@ -232,21 +228,14 @@ class Audit extends BaseController
                     'admin_time' => time(),
                     'admin_time' => time(),
                     'admin_id'   => $request->adminInfo['id'],
                     'admin_id'   => $request->adminInfo['id'],
                 ]);
                 ]);
-            // 删除以前的资料
-            (new TypeAudit)->where('uid', $certData['uid'])->where("id", "<>", $certData["id"])->delete();
-            // 更新员工信息,添加注册编号
-            (new TypeAudit)
-                ->where('uid', $certData['uid'])
-                ->save([
-                    'employee_number' => $employee_number,
-                    // 其他更新的员工信息
-                ]);
+            //删除以前的资料
+            (new TypeAudit)->where('uid', $certData['uid'])->where("id","<>",$certData["id"])->delete();
             return app('json')->success('操作成功');
             return app('json')->success('操作成功');
         }
         }
         //审核驳回
         //审核驳回
         if ($post['type'] == -1) {
         if ($post['type'] == -1) {
-            if (empty($post['mono'])) {
-                return app('json')->fail('请输入驳回理由');
+            if(empty($post['mono'])){
+                return app('json')->fail( '请输入驳回理由');
             }
             }
             (new TypeAudit)
             (new TypeAudit)
                 ->where('id', $post['id'])
                 ->where('id', $post['id'])