用户唯一维度支持系统标识
parent
5929e209b3
commit
1dcec6c517
|
|
@ -177,6 +177,7 @@ return [
|
|||
'base_item_redis_cache_title' => 'Redis Cache Config',
|
||||
'base_item_crontab_config_title' => 'Timing Script Config',
|
||||
'base_item_quick_nav_title' => 'Quick Navigation',
|
||||
'base_item_user_base_title' => 'User Base',
|
||||
'base_item_user_address_title' => 'User Address',
|
||||
'base_item_multilingual_title' => 'Multilingual',
|
||||
'base_item_site_auto_mode_title' => 'Automatic Mode',
|
||||
|
|
@ -216,6 +217,10 @@ return [
|
|||
'1. Click the title of the item to drag and sort it and display it in order',
|
||||
'2. It is not recommended to add many goods, which will lead to too large blank area on the left side of the PC',
|
||||
],
|
||||
'user_unique_system_type_model_tips_list'=> [
|
||||
'1. By default, [User Name, Mobile Phone, Email] is used as the unique user',
|
||||
'2. If enabled, add the [System ID] and act as the unique user',
|
||||
],
|
||||
'extends_crontab_tips' => 'It is recommended that you add the script address to the timing request of the Linux scheduled task (the result is SUCS: 0, FAIL: 0, followed by the colon is the number of data processed, SUCS succeeded, FALI failed)',
|
||||
'left_images_random_tips' => 'The left picture can upload up to 3 pictures, and one of them can be displayed randomly each time',
|
||||
'background_color_tips' => 'Customizable background image, default background gray',
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ return [
|
|||
'base_item_redis_cache_title' => 'redis缓存配置',
|
||||
'base_item_crontab_config_title' => '定时脚本配置',
|
||||
'base_item_quick_nav_title' => '快捷导航',
|
||||
'base_item_user_base_title' => '用户基础',
|
||||
'base_item_user_address_title' => '用户地址',
|
||||
'base_item_multilingual_title' => '多语言',
|
||||
'base_item_site_auto_mode_title' => '自动模式',
|
||||
|
|
@ -216,6 +217,10 @@ return [
|
|||
'1. 可点击商品标题拖拽排序、按照顺序展示',
|
||||
'2. 不建议添加很多商品、会导致PC端左侧空白区域太大',
|
||||
],
|
||||
'user_unique_system_type_model_tips_list'=> [
|
||||
'1. 默认以【用户名、手机、邮箱】作为用户唯一',
|
||||
'2. 开启则加入【系统标识】并行作为用户唯一',
|
||||
],
|
||||
'extends_crontab_tips' => '建议将脚本地址添加到linux定时任务定时请求即可(结果 sucs:0, fail:0 冒号后面则是处理的数据条数,sucs成功,fali失败)',
|
||||
'left_images_random_tips' => '左侧图片最多可上传3张图片、每次随机展示其中一张',
|
||||
'background_color_tips' => '可自定义背景图片、默认底灰色',
|
||||
|
|
|
|||
|
|
@ -101,6 +101,29 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 用户基础 -->
|
||||
<div class="am-panel am-panel-default am-margin-top-sm">
|
||||
<div class="am-panel-hd">
|
||||
<h3 class="am-panel-title">{{:MyLang('site.base_item_user_base_title')}}</h3>
|
||||
</div>
|
||||
<div class="am-panel-bd am-padding-vertical-xs">
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_user_unique_system_type_model.name}}<span class="am-form-group-label-tips">{{$data.common_user_unique_system_type_model.describe}}</span></label>
|
||||
<select name="{{$data.common_user_unique_system_type_model.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_user_unique_system_type_model.error_tips}}" required>
|
||||
{{foreach $common_close_open_list as $v}}
|
||||
<option value="{{$v.value}}" {{if isset($data['common_user_unique_system_type_model']['value']) and $data['common_user_unique_system_type_model']['value'] eq $v['value']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
{{if is_array(MyLang('site.user_unique_system_type_model_tips_list'))}}
|
||||
<div class="am-alert am-alert-warning" data-am-alert>
|
||||
<button type="button" class="am-close">×</button>
|
||||
<p>{{:implode('</p><p>', MyLang('site.user_unique_system_type_model_tips_list'))}}</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 用户地址 -->
|
||||
<div class="am-panel am-panel-default am-margin-top-sm">
|
||||
<div class="am-panel-hd">
|
||||
|
|
@ -123,7 +146,6 @@
|
|||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_extraction_address_position.name}}<span class="am-form-group-label-tips">{{$data.home_extraction_address_position.describe}}</span></label>
|
||||
<select name="{{$data.home_extraction_address_position.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.home_extraction_address_position.error_tips}}" required>
|
||||
|
|
|
|||
|
|
@ -1145,7 +1145,8 @@ class UserService
|
|||
}
|
||||
|
||||
// 获取用户账户信息
|
||||
$user = self::UserBaseInfo($ac['data'], $params['accounts']);
|
||||
$method = self::UserUniqueMethod();
|
||||
$user = self::$method($ac['data'], $params['accounts']);
|
||||
if(empty($user))
|
||||
{
|
||||
return DataReturn(MyLang('accounts_error_tips'), -3);
|
||||
|
|
@ -1531,10 +1532,24 @@ class UserService
|
|||
*/
|
||||
private static function IsExistAccounts($accounts, $field = 'mobile')
|
||||
{
|
||||
$temp = self::UserBaseInfo($field, $accounts, 'id');
|
||||
$method = self::UserUniqueMethod();
|
||||
$temp = self::$method($field, $accounts, 'id');
|
||||
return !empty($temp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户校验唯一方法
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2023-03-22
|
||||
* @desc description
|
||||
*/
|
||||
public static function UserUniqueMethod()
|
||||
{
|
||||
return (MyC('common_user_unique_system_type_model') == 1) ? 'UserInfo' : 'UserBaseInfo';
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否开启图片验证码校验
|
||||
* @author Devil
|
||||
|
|
@ -2463,24 +2478,26 @@ class UserService
|
|||
*/
|
||||
public static function UserInsert($data, $params = [])
|
||||
{
|
||||
// 用户唯一方法
|
||||
$method = self::UserUniqueMethod();
|
||||
// 用户名、手机、邮箱不允许重复注册
|
||||
if(!empty($data['username']))
|
||||
{
|
||||
$temp = self::UserBaseInfo('username', $data['username']);
|
||||
$temp = self::$method('username', $data['username']);
|
||||
if(!empty($temp))
|
||||
{
|
||||
return DataReturn(str_replace('{$var}', $data['username'], MyLang('common_service.user.save_user_already_exist_tips')), -10);
|
||||
}
|
||||
} else if(!empty($data['mobile']))
|
||||
{
|
||||
$temp = self::UserBaseInfo('mobile', $data['mobile']);
|
||||
$temp = self::$method('mobile', $data['mobile']);
|
||||
if(!empty($temp))
|
||||
{
|
||||
return DataReturn(MyLang('common_service.user.mobile_already_exist_tips'), -10);
|
||||
}
|
||||
} else if(!empty($data['email']))
|
||||
{
|
||||
$temp = self::UserBaseInfo('email', $data['email']);
|
||||
$temp = self::$method('email', $data['email']);
|
||||
if(!empty($temp))
|
||||
{
|
||||
return DataReturn(MyLang('common_service.user.email_already_exist_tips'), -10);
|
||||
|
|
|
|||
Loading…
Reference in New Issue