添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材 添加系统版本配置文件(.version)和常量定义文件(.constant) 更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件 添加验证码配置文件(captcha.php)和.gitignore规则
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\controller\api\v1\user;
|
|
|
|
use app\Request;
|
|
use app\services\agent\DivisionApplyServices;
|
|
use app\services\agent\PromoterApplyServices;
|
|
use crmeb\services\CacheService;
|
|
use think\annotation\Inject;
|
|
|
|
class PromoterApply
|
|
{
|
|
/**
|
|
* @var PromoterApplyServices
|
|
*/
|
|
#[Inject]
|
|
protected PromoterApplyServices $services;
|
|
|
|
|
|
public function applyInfo(Request $request)
|
|
{
|
|
$user = $request->user();
|
|
$uid = $request->uid();
|
|
$data = $this->services->applyInfo($uid, $user);
|
|
return app('json')->success($data);
|
|
}
|
|
|
|
public function applyPromoter(Request $request, $id)
|
|
{
|
|
$data = $request->postMore([
|
|
['uid', 0],
|
|
['nickname', ''],
|
|
['real_name', ''],
|
|
['phone', ''],
|
|
['code', 0]
|
|
]);
|
|
$data['uid'] = $request->uid();
|
|
$userInfo = $request->user();
|
|
if (sys_config('brokerage_apply_phone_verify') == 1) {
|
|
$verifyCode = CacheService::get('code_' . $data['phone']);
|
|
if ($verifyCode != $data['code']) return app('json')->fail('验证码错误');
|
|
}
|
|
unset($data['code']);
|
|
$data['refusal_reason'] = '';
|
|
$id = $this->services->applyPromoter($data, $id, $userInfo);
|
|
return app('json')->success('申请成功', ['id' => $id]);
|
|
}
|
|
}
|