mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-26 20:52:44 +08:00
46 lines
1007 B
PHP
46 lines
1007 B
PHP
<?php
|
|
|
|
namespace App\Services\Logic\User\Console;
|
|
|
|
use App\Repos\User as UserRepo;
|
|
use App\Services\Logic\Service as LogicService;
|
|
|
|
class ContactInfo extends LogicService
|
|
{
|
|
|
|
public function handle()
|
|
{
|
|
$user = $this->getLoginUser();
|
|
|
|
$userRepo = new UserRepo();
|
|
|
|
$contact = $userRepo->findUserContact($user->id);
|
|
|
|
if (!$contact) {
|
|
return $this->defaultContactInfo();
|
|
}
|
|
|
|
return [
|
|
'name' => $contact->name,
|
|
'phone' => $contact->phone,
|
|
'add_province' => $contact->add_province,
|
|
'add_city' => $contact->add_city,
|
|
'add_county' => $contact->add_county,
|
|
'add_other' => $contact->add_other,
|
|
];
|
|
}
|
|
|
|
protected function defaultContactInfo()
|
|
{
|
|
return [
|
|
'name' => '',
|
|
'phone' => '',
|
|
'add_province' => '',
|
|
'add_city' => '',
|
|
'add_county' => '',
|
|
'add_other' => '',
|
|
];
|
|
}
|
|
|
|
}
|