50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller\Customer;
|
|
|
|
use app\BaseController;
|
|
use app\common\model\Customer\Customer as ModelCustomer;
|
|
use app\Request;
|
|
use think\Validate;
|
|
use think\exception\ValidateException;
|
|
use think\facade\Filesystem;
|
|
use app\common\arw\adjfut\src\Excel;
|
|
use app\common\arw\adjfut\src\UploadFile;
|
|
use app\common\exception\Tool;
|
|
use think\facade\Db;
|
|
use app\common\model\Token as ModelToken;
|
|
use think\facade\Env;
|
|
|
|
|
|
class Customer extends BaseController
|
|
{
|
|
/**
|
|
* 获取客户信息接口
|
|
*
|
|
* @param Request $request
|
|
* @return array
|
|
* @date 2023-07-14
|
|
* @author xjh
|
|
* @since 1.0.0
|
|
*/
|
|
public function getCustomerInfo(Request $request): array
|
|
{
|
|
$token = ModelToken::getCurrent();
|
|
if ($token->token_type != ModelToken::CUSTOMER_TYPE) {
|
|
throwErrorMsg("当前token不是客户");
|
|
}
|
|
$customer = ModelCustomer::field([
|
|
'customer_guid',
|
|
'customer_name',
|
|
'customer_email',
|
|
'customer_blacklist',
|
|
'customer_create_time',
|
|
])->find($token->user_guid);
|
|
if (!$customer) {
|
|
throwErrorMsg("客户不存在!", 1);
|
|
}
|
|
return msg(0, "获取客户信息成功!", [
|
|
'data' => $customer
|
|
]);
|
|
}
|
|
} |