|
@@ -29,6 +29,18 @@ class CheckWx
|
|
|
if (empty($employee)) return response()->json(['code'=> 202,'msg'=>'用户信息不存在!','data'=>null]);
|
|
|
$employee = $employee->toArray();
|
|
|
if (empty($employee['mobile'])) return response()->json(['code'=> 202,'msg'=>'用户手机信息不存在!','data'=>null]);
|
|
|
+ if (empty($employee['employee_id'])) {
|
|
|
+ //找到对应的账号
|
|
|
+ $emp = Employee::where('del_time',0)
|
|
|
+ ->where('mobile',$employee['mobile'])
|
|
|
+ ->where('state',Employee::USE)
|
|
|
+ ->select('id')
|
|
|
+ ->first();
|
|
|
+ if(empty($emp)) return response()->json(['code'=> 202,'msg'=>'用户手机信息未匹配到系统账号!','data'=>null]);
|
|
|
+ $emp = $emp->toArray();
|
|
|
+ WxEmployee::where('id',$employee['id'])->update(['employee_id' => $emp['id']]);
|
|
|
+ $employee['employee_id'] = $emp['id'];
|
|
|
+ }
|
|
|
|
|
|
//当前请求接口
|
|
|
$uri = $request->path();
|