success([ 'all' => (new InfoAudit)->count(), 'wait' => (new InfoAudit)->where('status', 0)->count(), 'ok' => (new InfoAudit)->where('status', 1)->count(), 'no' => (new InfoAudit)->where('status', -1)->count(), ]); } /** * 获取第一步审核列表 * @param Request $request */ public function infoAuditList(Request $request) { $post = UtilService::getMore( [ ['page', 1], ['pageSize', 50], ['keyword',''], ['mobile',''], ['user_mobile',''], ['status', ''], ['uid', ''], ['time',[]], ], $request ); $data = (new InfoAudit)->getList($post,1); return app('json')->success([ 'list' => $data["list"], 'pageCount' => $data["totalCount"], 'pageSize' => $data["pageSize"], 'page' => $data["page"], ]); } /** * 信息认证详情 * @param Request $request */ public function infoAuditInfo(Request $request){ $post = UtilService::getMore([ ['id', '', 'empty', '参数错误'], ], $request); $data = (new InfoAudit)->getItem($post,1); if(empty($data)){ return app('json')->fail('数据不存在'); } return app('json')->success($data); } /** * 第一步审核处理 * @param Request $request */ public function infoAuditSub(Request $request) { $post = UtilService::getMore( [ ['id', '', 'empty', '参数错误'], ['mono'], ['type', 0], ], $request); $certData = (new InfoAudit)->where('id', $post['id'])->find(); if (empty($certData)) { return app('json')->fail('数据不存在'); } if ($certData['status']!=0) { return app('json')->fail( '当前审核已处理'); } //审核通过 if ($post['type'] == 1) { (new InfoAudit) ->where('id', $post['id']) ->save([ '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 UserShowTemplate)->userBindTempInit($certData["uid"]); //删除以前的资料 (new InfoAudit)->where('uid', $certData['uid'])->where("id","<>",$certData["id"])->delete(); return app('json')->success('操作成功'); } //审核驳回 if ($post['type'] == -1) { if(empty($post['mono'])){ return app('json')->fail( '请输入驳回理由'); } (new InfoAudit) ->where('id', $post['id']) ->save([ 'status' => -1, 'admin_mono' => $post['mono'], 'admin_time' => time(), 'admin_id' => $request->adminInfo['id'], ]); return app('json')->success('已驳回'); } } /** * 平台认证初始化 * @return type */ public function typeAuditInit() { return app('json')->success([ 'all' => (new TypeAudit)->count(), 'wait' => (new TypeAudit)->where('status', 0)->count(), 'ok' => (new TypeAudit)->where('status', 1)->count(), 'no' => (new TypeAudit)->where('status', -1)->count(), ]); } /** * 平台认证详情 * @param Request $request */ public function typeAuditInfo(Request $request){ $post = UtilService::getMore([ ['id', '', 'empty', '参数错误'], ], $request); $data = (new TypeAudit)->getItem($post,1); if(empty($data)){ return app('json')->fail('数据不存在'); } return app('json')->success($data); } /** * 获取平台认证审核列表 * @param Request $request */ public function typeAuditList(Request $request) { $post = UtilService::getMore( [ ['page', 1], ['pageSize', 50], ['keyword',''], ['mobile',''], ['user_mobile',''], ['status', ''], ['uid', ''], ['time',[]], ], $request ); $data = (new TypeAudit)->getList($post,1); return app('json')->success([ 'list' => $data["list"], 'pageCount' => $data["totalCount"], 'pageSize' => $data["pageSize"], 'page' => $data["page"], ]); } /** * 第一步审核处理 * @param Request $request */ public function typeAuditSub(Request $request) { $post = UtilService::getMore( [ ['id', '', 'empty', '参数错误'], ['mono'], ['type', 0], ], $request); $certData = (new TypeAudit)->where('id', $post['id'])->find(); if (empty($certData)) { return app('json')->fail('数据不存在'); } if ($certData['status']!=0) { return app('json')->fail( '当前审核已处理'); } //审核通过 if ($post['type'] == 1) { (new TypeAudit) ->where('id', $post['id']) ->save([ 'status' => 1, 'admin_mono' => $post['mono'], 'admin_time' => time(), 'admin_id' => $request->adminInfo['id'], ]); //删除以前的资料 (new TypeAudit)->where('uid', $certData['uid'])->where("id","<>",$certData["id"])->delete(); return app('json')->success('操作成功'); } //审核驳回 if ($post['type'] == -1) { if(empty($post['mono'])){ return app('json')->fail( '请输入驳回理由'); } (new TypeAudit) ->where('id', $post['id']) ->save([ 'status' => -1, 'admin_mono' => $post['mono'], 'admin_time' => time(), 'admin_id' => $request->adminInfo['id'], ]); return app('json')->success('已驳回'); } } }