其余文件
This commit is contained in:
43
app/admin/validate/shop/ShopApplyValidate.php
Normal file
43
app/admin/validate/shop/ShopApplyValidate.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\shop;
|
||||
|
||||
|
||||
use app\common\basics\Validate;
|
||||
|
||||
class ShopApplyValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'id' => 'require|number',
|
||||
'audit_status' => 'require|number'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => 'ID不可为空',
|
||||
'id.number' => 'ID必须为数字',
|
||||
'audit_status.require' => '请选择审核状态',
|
||||
'audit_status.number' => '审核状态选择异常',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'id' => ['id'],
|
||||
'audit' => ['id', 'audit']
|
||||
];
|
||||
}
|
||||
89
app/admin/validate/shop/StoreLValidate.php
Normal file
89
app/admin/validate/shop/StoreLValidate.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\shop;
|
||||
|
||||
|
||||
use app\common\basics\Validate;
|
||||
|
||||
class StoreLValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'id' => 'require|number',
|
||||
'cid' => 'require|number',
|
||||
'type' => 'require|in:1,2',
|
||||
'name' => 'require',
|
||||
'nickname' => 'require',
|
||||
'mobile' => 'require|mobile',
|
||||
'account' => 'require|unique:ShopAdmin',
|
||||
'password' => 'require|min:6',
|
||||
'okPassword' => 'require|min:6|confirm:password',
|
||||
'logo' => 'require',
|
||||
'trade_service_fee' => 'require|float',
|
||||
'weight' => 'require|number',
|
||||
'is_run' => 'require|in:0,1',
|
||||
'is_freeze' => 'require|in:0,1',
|
||||
'is_product_audit' => 'require|in:0,1',
|
||||
'is_recommend' => 'require',
|
||||
'is_distribution' => 'require',
|
||||
'is_pay' => 'require',
|
||||
'expire_time' => 'require',
|
||||
'delivery_type' => 'require'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => 'id不可为空',
|
||||
'id.number' => 'id必须为数字',
|
||||
'type.require' => '请选择商家类型',
|
||||
'type.in' => '选择的商家类型不符合',
|
||||
'name.require' => '请填写商家名称',
|
||||
'nickname.require' => '请填写联系人',
|
||||
'mobile.require' => '请填写联系手机号',
|
||||
'logo.require' => '请选择商家logo',
|
||||
'expire_time.require' => '请选择到期时间',
|
||||
'trade_service_fee.require' => '请填写交易服务费率',
|
||||
'is_product_audit.require' => '请选择产品是否需要审核',
|
||||
'is_run.require' => '请选择店铺营业状态',
|
||||
'is_freeze.require' => '请选择商家状态',
|
||||
'account.require' => '请填写商家账号',
|
||||
'account.unique' => '商家账号不可重复',
|
||||
'password.require' => '请填写登录密码',
|
||||
'password.min' => '登录密码最少6位数',
|
||||
'okPassword.require' => '请填写确认登录密码',
|
||||
'okPassword.confirm' => '两次密码不一致',
|
||||
'weight.require' => '权重不可为空',
|
||||
'weight.number' => '权重必须为数字',
|
||||
'is_recommend.require' => '请选择是否推荐商家',
|
||||
'is_distribution.require' => '请选择是否允许分销',
|
||||
'is_pay.require' => '请选择是否开启支付功能',
|
||||
'delivery_type.require' => '最少选择一种配送方式',
|
||||
];
|
||||
|
||||
|
||||
|
||||
protected $scene = [
|
||||
'id' => ['id'],
|
||||
'add' => ['cid', 'type', 'delivery_type', 'name', 'nickname', 'mobile', 'account', 'password', 'okPassword', 'logo', 'trade_service_fee', 'is_run', 'is_freeze', 'is_product_audit', 'expire_time'],
|
||||
'edit' => ['id', 'cid', 'type', 'name', 'delivery_type', 'nickname', 'mobile', 'logo', 'trade_service_fee', 'is_run', 'is_freeze', 'is_product_audit', 'expire_time'],
|
||||
'set' => ['id', 'is_recommend', 'weight', 'is_distribution', 'is_pay'],
|
||||
'account' => ['id'],
|
||||
'pwd' => ['password', 'okPassword']
|
||||
];
|
||||
|
||||
}
|
||||
68
app/admin/validate/shop/StoreStatusValidate.php
Normal file
68
app/admin/validate/shop/StoreStatusValidate.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\validate\shop;
|
||||
|
||||
|
||||
use app\common\basics\Validate;
|
||||
use app\common\model\shop\Shop;
|
||||
|
||||
/**
|
||||
* 商家状态验证(营业状态,冻结状态)
|
||||
* Class StoreStatusValidate
|
||||
* @package app\admin\validate\shop
|
||||
*/
|
||||
class StoreStatusValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'ids' => 'require',
|
||||
'field' => 'require|checkField',
|
||||
'value' => 'require|in:0,1',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'ids.require' => 'id不可为空',
|
||||
'ids.number' => 'id必须为数字',
|
||||
'field.require' => '参数缺失',
|
||||
'value.require' => '参数缺失',
|
||||
'value.in' => '参数错误',
|
||||
];
|
||||
|
||||
/**
|
||||
* @notes 验证字段
|
||||
* @param $value
|
||||
* @param $rule
|
||||
* @param $data
|
||||
* @return bool|string
|
||||
* @author 段誉
|
||||
* @date 2022/3/17 10:40
|
||||
*/
|
||||
public function checkField($value, $rule, $data)
|
||||
{
|
||||
$checArr = ['is_run', 'is_freeze'];
|
||||
|
||||
if (!in_array($value, $checArr)) {
|
||||
return '参数错误';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user