|
|
@@ -356,13 +356,18 @@ class MasterWorkerLogic extends BaseLogic
|
|
|
}
|
|
|
public static function getRegInfo(array $params)
|
|
|
{
|
|
|
- if (empty($params['user']))
|
|
|
+ if (empty($params['user'])){
|
|
|
return 0;
|
|
|
+ }
|
|
|
$user = trim($params['user']);
|
|
|
- $mobile = intval($user);
|
|
|
+ $pattern = '/(\d{11})/';
|
|
|
+ if (preg_match($pattern, $user, $matches)) {
|
|
|
+ // 提取手机号
|
|
|
+ $mobile = $matches[1];
|
|
|
+ }
|
|
|
+
|
|
|
$specialChars = array('.', ',', '。', ',', $mobile);
|
|
|
- $name = str_replace($specialChars,"",$mobile);
|
|
|
-
|
|
|
+ $name = str_replace($specialChars,"",$user);
|
|
|
return (int)MasterWorkerRegister::where('name',$name)->where('mobile',$mobile)->value('id');
|
|
|
}
|
|
|
|