|
|
@@ -95,43 +95,41 @@ class Audit extends BaseController
|
|
|
*/
|
|
|
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();
|
|
|
if (empty($certData)) {
|
|
|
return app('json')->fail('数据不存在');
|
|
|
}
|
|
|
- if ($certData['status'] != 0) {
|
|
|
- return app('json')->fail('当前审核已处理');
|
|
|
+ if ($certData['status']!=0) {
|
|
|
+ return app('json')->fail( '当前审核已处理');
|
|
|
}
|
|
|
//审核通过
|
|
|
if ($post['type'] == 1) {
|
|
|
- //生成注册编号
|
|
|
- $employeeNumber = 'MYJ' . date('Ymd') . str_pad($certData['id'], 6, '0', STR_PAD_LEFT);
|
|
|
(new InfoAudit)
|
|
|
->where('id', $post['id'])
|
|
|
->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 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('操作成功');
|
|
|
}
|
|
|
//审核驳回
|
|
|
if ($post['type'] == -1) {
|
|
|
- if (empty($post['mono'])) {
|
|
|
- return app('json')->fail('请输入驳回理由');
|
|
|
+ if(empty($post['mono'])){
|
|
|
+ return app('json')->fail( '请输入驳回理由');
|
|
|
}
|
|
|
(new InfoAudit)
|
|
|
->where('id', $post['id'])
|
|
|
@@ -141,8 +139,6 @@ class Audit extends BaseController
|
|
|
'admin_time' => time(),
|
|
|
'admin_id' => $request->adminInfo['id'],
|
|
|
]);
|
|
|
- //删除以前的资料
|
|
|
- (new InfoAudit)->where('uid', $certData['uid'])->where("id", "<>", $certData["id"])->delete();
|
|
|
return app('json')->success('已驳回');
|
|
|
}
|
|
|
}
|
|
|
@@ -209,21 +205,21 @@ class Audit extends BaseController
|
|
|
*/
|
|
|
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();
|
|
|
if (empty($certData)) {
|
|
|
return app('json')->fail('数据不存在');
|
|
|
}
|
|
|
- if ($certData['status'] != 0) {
|
|
|
- return app('json')->fail('当前审核已处理');
|
|
|
+ if ($certData['status']!=0) {
|
|
|
+ return app('json')->fail( '当前审核已处理');
|
|
|
}
|
|
|
//审核通过
|
|
|
if ($post['type'] == 1) {
|
|
|
- $employee_number = 'MYJ' . date('Ymd') . str_pad((new TypeAudit)->count() + 100000, 6, '0', STR_PAD_LEFT);
|
|
|
(new TypeAudit)
|
|
|
->where('id', $post['id'])
|
|
|
->save([
|
|
|
@@ -232,21 +228,14 @@ class Audit extends BaseController
|
|
|
'admin_time' => time(),
|
|
|
'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('操作成功');
|
|
|
}
|
|
|
//审核驳回
|
|
|
if ($post['type'] == -1) {
|
|
|
- if (empty($post['mono'])) {
|
|
|
- return app('json')->fail('请输入驳回理由');
|
|
|
+ if(empty($post['mono'])){
|
|
|
+ return app('json')->fail( '请输入驳回理由');
|
|
|
}
|
|
|
(new TypeAudit)
|
|
|
->where('id', $post['id'])
|