|
|
@ -765,11 +765,63 @@ class PromoteService {
|
|
|
|
return self::$levels[$level] ?? '未知';
|
|
|
|
return self::$levels[$level] ?? '未知';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function checkAddPromote($params)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$account = isset($params['account']) ? trim($params['account']) : '';
|
|
|
|
|
|
|
|
$password = $params['password'] ?? '';
|
|
|
|
|
|
|
|
$repassword = $params['repassword'] ?? '';
|
|
|
|
|
|
|
|
$mobile = $params['mobile_phone'] ?? '';
|
|
|
|
|
|
|
|
$idcard = $params['idcard'] ?? '';
|
|
|
|
|
|
|
|
$realName = $params['real_name'] ?? '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($account == '') {
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'status' => false,
|
|
|
|
|
|
|
|
'message' => '请输入推广员账号',
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strlen($account) > 15 || strlen($account) < 6) {
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'status' => false,
|
|
|
|
|
|
|
|
'message' => '账号长度为6-15个字符',
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($password == '') {
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'status' => false,
|
|
|
|
|
|
|
|
'message' => '请输入登录密码',
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($repassword != $password) {
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'status' => false,
|
|
|
|
|
|
|
|
'message' => '确认密码跟密码不一致',
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strlen($password) < 6) {
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'status' => false,
|
|
|
|
|
|
|
|
'message' => '密码长度必须大于6位',
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$promote = M('promote', 'tab_')->field(['id'])->where(['account' => $account])->find();
|
|
|
|
|
|
|
|
if ($promote) {
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'status' => false,
|
|
|
|
|
|
|
|
'message' => '渠道账号已存在',
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'status' => true,
|
|
|
|
|
|
|
|
'message' => '验证成功',
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function addPromote($params, $parent = null)
|
|
|
|
public function addPromote($params, $parent = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$data = [
|
|
|
|
$data = [
|
|
|
|
'account' => $params['account'],
|
|
|
|
'account' => $params['account'],
|
|
|
|
'password' => $params['password'],
|
|
|
|
'password' => $this->password($params['password']),
|
|
|
|
'nickname' => $params['nickname'] ?? $params['account'],
|
|
|
|
'nickname' => $params['nickname'] ?? $params['account'],
|
|
|
|
'second_pwd' => $params['second_pwd'] ?? null,
|
|
|
|
'second_pwd' => $params['second_pwd'] ?? null,
|
|
|
|
'real_name' => $params['real_name'],
|
|
|
|
'real_name' => $params['real_name'],
|
|
|
|