diff --git a/beike/Shop/Services/AccountService.php b/beike/Shop/Services/AccountService.php index 1e01b7f1..d0d39698 100644 --- a/beike/Shop/Services/AccountService.php +++ b/beike/Shop/Services/AccountService.php @@ -30,7 +30,10 @@ class AccountService $data['status'] = !setting('approve_customer'); // approve_customer为是否需要审核客户 $data['from'] = $data['from'] ?? 'pc'; $data['locale'] = locale(); - $data['name'] = ''; + + if ($data['email'] ?? 0) { + $data['name'] = substr($data['email'], 0, strrpos($data['email'], '@'));; + } $data['avatar'] = ''; return CustomerRepo::create($data);