init commit
This commit is contained in:
27
application/admin/validate/wdsxh/member/Cert.php
Normal file
27
application/admin/validate/wdsxh/member/Cert.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\wdsxh\member;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Cert extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
36
application/admin/validate/wdsxh/member/Company.php
Normal file
36
application/admin/validate/wdsxh/member/Company.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\wdsxh\member;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Company extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
54
application/admin/validate/wdsxh/member/FeesConfig.php
Normal file
54
application/admin/validate/wdsxh/member/FeesConfig.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\wdsxh\member;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class FeesConfig extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
'expire_time_type' => 'require|checkDaysAndDate',
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'edit' => ['expire_time_type'],
|
||||
];
|
||||
|
||||
protected function checkDaysAndDate($value,$rule,$data)
|
||||
{
|
||||
if ($value == 1) {//自由时间验证
|
||||
if (empty($data['days'])) {
|
||||
return '请输入自由时间天数';
|
||||
}
|
||||
} else {
|
||||
if (empty($data['fixed_date'])) {
|
||||
return '请选择固定日期';
|
||||
}
|
||||
$fixed_date = (new \app\admin\model\wdsxh\member\FeesConfig())->where('id',1)->value('fixed_date');
|
||||
if( ($fixed_date != $data['fixed_date']) && $data['fixed_date'] <= date('Y-m-d',time())) {
|
||||
return '固定时间只能设置当前时间之后的时间';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
36
application/admin/validate/wdsxh/member/IndustryCategory.php
Normal file
36
application/admin/validate/wdsxh/member/IndustryCategory.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\wdsxh\member;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class IndustryCategory extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
27
application/admin/validate/wdsxh/member/JoinConfig.php
Normal file
27
application/admin/validate/wdsxh/member/JoinConfig.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\validate\wdsxh\member;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class JoinConfig extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
48
application/admin/validate/wdsxh/member/Level.php
Normal file
48
application/admin/validate/wdsxh/member/Level.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\wdsxh\member;
|
||||
|
||||
use app\admin\model\wdsxh\member\FeesConfig;
|
||||
use think\Validate;
|
||||
|
||||
class Level extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
'fees'=>'require|checkFees',
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => ['fees'],
|
||||
'edit' => ['fees'],
|
||||
];
|
||||
|
||||
protected function checkFees($value,$rule,$data)
|
||||
{
|
||||
//todo 免费入会和会员级别0元冲突问题:
|
||||
$pay_method = (new FeesConfig())->where('id',1)->value('pay_method');
|
||||
if (($pay_method != '1') && $value <= 0) {
|
||||
return '请前往入会设置→免费入会';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
59
application/admin/validate/wdsxh/member/Member.php
Normal file
59
application/admin/validate/wdsxh/member/Member.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\wdsxh\member;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Member extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
'mobile'=>'require|checkMobile',
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
'mobile.require' => '手机号不能为空',
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => ['mobile'],
|
||||
'edit' => ['mobile'],
|
||||
];
|
||||
|
||||
protected function checkMobile($value,$rule,$data)
|
||||
{
|
||||
$memberModel = new \app\api\model\wdsxh\member\Member();
|
||||
if (isset($data['id']) && !empty($data['id'])) {//编辑
|
||||
$memberId = $memberModel->where('id','<>',$data['id'])
|
||||
->where('mobile',$value)
|
||||
->value('id');
|
||||
if ($memberId) {
|
||||
return '手机号已被使用';
|
||||
}
|
||||
} else {
|
||||
$memberId = $memberModel
|
||||
->where('mobile',$value)
|
||||
->value('id');
|
||||
if ($memberId) {
|
||||
return '手机号已被使用';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
36
application/admin/validate/wdsxh/member/Organize.php
Normal file
36
application/admin/validate/wdsxh/member/Organize.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\wdsxh\member;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Organize extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
36
application/admin/validate/wdsxh/member/Person.php
Normal file
36
application/admin/validate/wdsxh/member/Person.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 麦沃德科技赋能开发者,助力商协会发展
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2024 www.wdsxh.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\wdsxh\member;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Person extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user