You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
18
hyhproject/admin/validate/Accreds.php
Executable file
18
hyhproject/admin/validate/Accreds.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 认证商家验证器
|
||||
*/
|
||||
class Accreds extends Validate{
|
||||
protected $rule = [
|
||||
['accredName' ,'require|max:30','请输入认证名称|认证名称不能超过30个字符'],
|
||||
['accredImg' ,'require','请上传图标']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['accredName','accredImg'],
|
||||
'edit' => ['accredName'],
|
||||
];
|
||||
}
|
22
hyhproject/admin/validate/AdPositions.php
Executable file
22
hyhproject/admin/validate/AdPositions.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告位置验证器
|
||||
*/
|
||||
class AdPositions extends Validate{
|
||||
protected $rule = [
|
||||
['positionName' ,'require|max:60','请输入位置名称|位置名称不能超过30个字符'],
|
||||
['positionCode' ,'require|max:60','请输入位置代码|位置代码不能超过20个字符'],
|
||||
['positionType' ,'require','请选择位置类型'],
|
||||
['positionWidth' ,'require|number','请输入建议宽度|建议宽度只能为数字'],
|
||||
['positionHeight' ,'require|number','请输入建议高度|建议高度只能为数字'],
|
||||
['apSort' ,'number','排序号只能为数字'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['positionName','positionCode','positionType','positionWidth','positionHeight','apSort'],
|
||||
'edit' => ['positionName','positionCode','positionType','positionWidth','positionHeight','apSort'],
|
||||
];
|
||||
}
|
21
hyhproject/admin/validate/Adgoods.php
Executable file
21
hyhproject/admin/validate/Adgoods.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告验证器
|
||||
*/
|
||||
class Adgoods extends Validate{
|
||||
protected $rule = [
|
||||
['adId' ,'require|max:30','请输入广告名称|广告名称不能超过10个字符'],
|
||||
['adGoodsImg' ,'require','请上传广告图片'],
|
||||
['goodsId' ,'require','请上传广告商品'],
|
||||
['startDate' , 'require', '请输入广告开始时间' ],
|
||||
['endDate' , 'require', '请输入广告结束时间'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['adName','adURL','startDate','endDate'],
|
||||
'edit' => ['adName','adURL','startDate','endDate'],
|
||||
];
|
||||
}
|
20
hyhproject/admin/validate/Ads.php
Executable file
20
hyhproject/admin/validate/Ads.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告验证器
|
||||
*/
|
||||
class Ads extends Validate{
|
||||
protected $rule = [
|
||||
['adName' ,'require|max:60','请输入广告标题|广告标题不能超过30个字'],
|
||||
['adFile' ,'require','请上传广告图片'],
|
||||
['adStartDate' , 'require', '请输入广告开始时间' ],
|
||||
['adEndDate' , 'require', '请输入广告结束时间'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['adName','adURL','adStartDate','adEndDate'],
|
||||
'edit' => ['adName','adURL','adStartDate','adEndDate'],
|
||||
];
|
||||
}
|
19
hyhproject/admin/validate/Areas.php
Executable file
19
hyhproject/admin/validate/Areas.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class Areas extends Validate{
|
||||
protected $rule = [
|
||||
['areaName' ,'require|max:30','请输入地区名称|地区名称不能超过10个字符'],
|
||||
['areaKey' ,'require|max:2','请输入排序字母|排序字母不能超过1个字符'],
|
||||
['areaSort' ,'require|max:16','请输入排序号|排序号不能超过8个字符'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['areaName','areaKey','areaSort'],
|
||||
'edit' => ['areaName','areaKey','areaSort'],
|
||||
];
|
||||
}
|
18
hyhproject/admin/validate/ArticleCats.php
Executable file
18
hyhproject/admin/validate/ArticleCats.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class ArticleCats extends Validate{
|
||||
protected $rule = [
|
||||
['catName' ,'require|max:30','请输入文章分类名称|文章分类名称不能超过10个字符'],
|
||||
['catSort' ,'require|max:16','请输入排序号|排序号不能超过8个字符'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['catName','catSort'],
|
||||
'edit' => ['catName','catSort'],
|
||||
];
|
||||
}
|
19
hyhproject/admin/validate/Articles.php
Executable file
19
hyhproject/admin/validate/Articles.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class Articles extends Validate{
|
||||
protected $rule = [
|
||||
['articleTitle' ,'require|max:150','请输入文章标题|文章标题不能超过50个字符'],
|
||||
['articleKey' ,'require|max:300','请输入关键字|关键字不能超过100个字符'],
|
||||
['articleContent' ,'require','请输入文章内容']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['articleTitle','articleKey','articleContent'],
|
||||
'edit' => ['articleTitle','articleKey','articleContent']
|
||||
];
|
||||
}
|
24
hyhproject/admin/validate/Attributes.php
Executable file
24
hyhproject/admin/validate/Attributes.php
Executable file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 属性验证器
|
||||
*/
|
||||
class Attributes extends Validate{
|
||||
protected $rule = [
|
||||
['attrName', 'require|max:60', '请输入属性名称|属性名称不能超过20个字符'],
|
||||
['attrType','in:0,1,2','请选择属性类型'],
|
||||
['attrVal','checkattrVal:1','请输入发票说明'],
|
||||
['isShow','in:0,1','请选择是否显示']
|
||||
];
|
||||
protected $scene = [
|
||||
'add'=>['attrName'],
|
||||
'edit'=>['attrName'],
|
||||
];
|
||||
protected function checkattrVal(){
|
||||
if(input('post.attrType/d')!=0 && input('post.attrVal')=='')return '请输入属性选项';
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
17
hyhproject/admin/validate/Banks.php
Executable file
17
hyhproject/admin/validate/Banks.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 银行验证器
|
||||
*/
|
||||
class Banks extends Validate{
|
||||
protected $rule = [
|
||||
['bankName' ,'require|max:30','请输入银行名称|银行名称不能超过10个字符'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['bankName'],
|
||||
'edit' => ['bankName'],
|
||||
];
|
||||
}
|
19
hyhproject/admin/validate/Brands.php
Executable file
19
hyhproject/admin/validate/Brands.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class Brands extends Validate{
|
||||
protected $rule = [
|
||||
['brandName' ,'require|max:100','请输入品牌名称|品牌名称不能超过50个字符'],
|
||||
['brandImg' ,'require','请上传品牌图标'],
|
||||
['brandDesc' ,'require','请输入品牌介绍']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['brandName','brandImg','brandDesc'],
|
||||
'edit' => ['brandName','brandImg','brandDesc']
|
||||
];
|
||||
}
|
18
hyhproject/admin/validate/ChargeItems.php
Executable file
18
hyhproject/admin/validate/ChargeItems.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 广告位置验证器
|
||||
*/
|
||||
class ChargeItems extends Validate{
|
||||
protected $rule = [
|
||||
['chargeMoney' ,'require|egt:1','请输入充值金额|充值金额必须大于0'],
|
||||
['giveMoney' ,'require|egt:0','请输入赠送金额|赠送金额必须不小于0'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['chargeMoney','giveMoney'],
|
||||
'edit' => ['chargeMoney','positionCode'],
|
||||
];
|
||||
}
|
18
hyhproject/admin/validate/DataCats.php
Executable file
18
hyhproject/admin/validate/DataCats.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 数据分类验证器
|
||||
*/
|
||||
class DataCats extends Validate{
|
||||
protected $rule = [
|
||||
['catName' ,'require','请输入数据分类名称'],
|
||||
['catCode' ,'require','请输入数据代码']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['catName','catCode'],
|
||||
'edit' => ['catName','catCode'],
|
||||
];
|
||||
}
|
18
hyhproject/admin/validate/Datas.php
Executable file
18
hyhproject/admin/validate/Datas.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 数据验证器
|
||||
*/
|
||||
class Datas extends Validate{
|
||||
protected $rule = [
|
||||
['dataName' ,'require','请输入数据名称'],
|
||||
['dataVal' ,'require','请输入数据值']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['dataName','dataVal'],
|
||||
'edit' => ['dataName','dataVal'],
|
||||
];
|
||||
}
|
17
hyhproject/admin/validate/Express.php
Executable file
17
hyhproject/admin/validate/Express.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 快递验证器
|
||||
*/
|
||||
class express extends Validate{
|
||||
protected $rule = [
|
||||
['expressName' ,'require|max:30','请输入快递名称|快递名称不能超过10个字符']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['expressName'],
|
||||
'edit' => ['expressName'],
|
||||
];
|
||||
}
|
18
hyhproject/admin/validate/Friendlinks.php
Executable file
18
hyhproject/admin/validate/Friendlinks.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class Friendlinks extends Validate{
|
||||
protected $rule = [
|
||||
['friendlinkName' ,'require|max:90','请输入网站名称|网站名称不能超过30个字符'],
|
||||
['friendlinkUrl' ,'require','请输入网址']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['friendlinkName'],
|
||||
'edit' => ['friendlinkName'],
|
||||
];
|
||||
}
|
19
hyhproject/admin/validate/GoodsAppraises.php
Executable file
19
hyhproject/admin/validate/GoodsAppraises.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class GoodsAppraises extends Validate{
|
||||
protected $rule = [
|
||||
['goodsScore','number|gt:0','评分只能是数字|评分必须大于0'],
|
||||
['timeScore','number|gt:0','评分只能是数字|评分必须大于0'],
|
||||
['serviceScore','number|gt:0','评分只能是数字|评分必须大于0'],
|
||||
['content','length:3,50','评价内容3-50个字'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'edit'=>['isShow','goodsScore','timeScore','serviceScore','content'],
|
||||
];
|
||||
}
|
19
hyhproject/admin/validate/GoodsCats.php
Executable file
19
hyhproject/admin/validate/GoodsCats.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class GoodsCats extends Validate{
|
||||
protected $rule = [
|
||||
['catName' ,'require|max:30','请输入商品分类名称|商品分类名称不能超过10个字符'],
|
||||
['commissionRate' ,'require','请输入分类佣金'],
|
||||
['catSort' ,'require|max:16','请输入排序号|排序号不能超过8个字符'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['catName','commissionRate','catSort'],
|
||||
'edit' => ['catName','commissionRate','catSort']
|
||||
];
|
||||
}
|
18
hyhproject/admin/validate/GoodsConsult.php
Executable file
18
hyhproject/admin/validate/GoodsConsult.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class GoodsConsult extends Validate{
|
||||
protected $rule = [
|
||||
['isShow','require|in:0,1','状态不能为空|状态必须为0或1'],
|
||||
['consultContent' ,'require|length:3,600','请输入咨询内容|咨询内容应为3-200个字'],
|
||||
['reply' ,'require|length:3,600','请输入回复内容|回复内容应为3-200个字']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'edit'=>['isShow','consultContent','reply'],
|
||||
];
|
||||
}
|
21
hyhproject/admin/validate/HomeMenus.php
Executable file
21
hyhproject/admin/validate/HomeMenus.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 菜单验证器
|
||||
*/
|
||||
class HomeMenus extends Validate{
|
||||
protected $rule = [
|
||||
['menuName' ,'require|max:30','请输入菜单名称|菜单名称不能超过10个字符'],
|
||||
['parentId' ,'number','无效的父级菜单'],
|
||||
['menuType' ,'require','请输入菜单类型'],
|
||||
['menuUrl' ,'require','请输入菜单Url'],
|
||||
['isShow' ,'require','请选择是否显示']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['menuName','parentId','menuType','menuUrl','isShow'],
|
||||
'edit' => ['menuName','menuType','menuUrl','isShow']
|
||||
];
|
||||
}
|
18
hyhproject/admin/validate/Menus.php
Executable file
18
hyhproject/admin/validate/Menus.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 菜单验证器
|
||||
*/
|
||||
class Menus extends Validate{
|
||||
protected $rule = [
|
||||
['menuName' ,'require|max:30','请输入菜单名称|菜单名称不能超过10个字符'],
|
||||
['parentId' ,'number','无效的父级菜单']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['menuName','parentId'],
|
||||
'edit' => ['menuName'],
|
||||
];
|
||||
}
|
19
hyhproject/admin/validate/MobileBtns.php
Executable file
19
hyhproject/admin/validate/MobileBtns.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 移动版按钮验证器
|
||||
*/
|
||||
class MobileBtns extends Validate{
|
||||
protected $rule = [
|
||||
['btnName' ,'require','请输入按钮名称'],
|
||||
['btnUrl' ,'require','请输入按钮名称'],
|
||||
['btnImg' ,'require','请上传图标']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['btnName','btnImg','btnUrl'],
|
||||
'edit' => ['btnName','btnUrl'],
|
||||
];
|
||||
}
|
19
hyhproject/admin/validate/Navs.php
Executable file
19
hyhproject/admin/validate/Navs.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 导航验证器
|
||||
*/
|
||||
class Navs extends Validate{
|
||||
protected $rule = [
|
||||
['navTitle|max:30', 'require', '请输入导航名称|导航名称不能超过10个字符'],
|
||||
['navUrl','require', '请输入导航链接'],
|
||||
['navSort','integer', '排序号只能为整数'],
|
||||
];
|
||||
protected $scene = [
|
||||
'add'=>['navTitle','navUrl','navSort'],
|
||||
'edit'=>['navTitle','navUrl','navSort'],
|
||||
];
|
||||
|
||||
}
|
17
hyhproject/admin/validate/Payments.php
Executable file
17
hyhproject/admin/validate/Payments.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 支付验证器
|
||||
*/
|
||||
class Payments extends Validate{
|
||||
protected $rule = [
|
||||
['payName','require','支付名称不能为空'],
|
||||
['payDesc','require','支付描述不能为空'],
|
||||
['payOrder','require','排序号不能为空'],
|
||||
];
|
||||
protected $scene = [
|
||||
'edit'=>['payName','payDesc','payOrder'],
|
||||
];
|
||||
}
|
19
hyhproject/admin/validate/Privileges.php
Executable file
19
hyhproject/admin/validate/Privileges.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 权限验证器
|
||||
*/
|
||||
class Privileges extends Validate{
|
||||
protected $rule = [
|
||||
['privilegeName' ,'require|max:60','请输入权限名称|权限名称不能超过20个字符'],
|
||||
['privilegeCode' ,'require|max:30','请输入权限代码|权限代码不能超过10个字符'],
|
||||
['menuId' ,'number','无效的权限菜单']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['privilegeName','privilegeCode','menuId'],
|
||||
'edit' => ['privilegeName','privilegeCode'],
|
||||
];
|
||||
}
|
17
hyhproject/admin/validate/Roles.php
Executable file
17
hyhproject/admin/validate/Roles.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 角色验证器
|
||||
*/
|
||||
class Roles extends Validate{
|
||||
protected $rule = [
|
||||
['roleName' ,'require|max:30','请输入角色名称|角色名称不能超过10个字符']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['menuName'],
|
||||
'edit' => ['menuName']
|
||||
];
|
||||
}
|
60
hyhproject/admin/validate/Shops.php
Executable file
60
hyhproject/admin/validate/Shops.php
Executable file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 店铺验证器
|
||||
*/
|
||||
class Shops extends Validate{
|
||||
protected $rule = [
|
||||
['shopSn','checkShopSn:1','请输入店铺编号|店铺编号不能超过20个字符'],
|
||||
['shopName' ,'require|max:40','请输入店铺名称|店铺名称不能超过20个字符'],
|
||||
['shopCompany' ,'require|max:300','请输入公司名称|公司名称不能超过100个字符'],
|
||||
['shopTel' ,'require|max:40','请输入公司联系电话|公司联系电话不能超过20个字符'],
|
||||
['shopkeeper' ,'require|max:100','请输入公司紧急联系人|公司紧急联系人不能超过50个字符'],
|
||||
['telephone' ,'require|max:40','请输入公司紧急联系人手机|公司紧急联系人手机不能超过20个字符'],
|
||||
['isSelf' ,'in:0,1','无效的自营店类型'],
|
||||
['shopImg' ,'require','请上传店铺图标'],
|
||||
['areaId' ,'require','请选择公司所在区域'],
|
||||
['shopAddress' ,'require','请输入公司详细地址'],
|
||||
['isInvoice' ,'in:0,1','无效的发票类型'],
|
||||
['invoiceRemarks','checkInvoiceRemark:1','请输入发票说明'],
|
||||
['shopAtive' ,'in:0,1','无效的营业状态'],
|
||||
['bankUserName' ,'require|max:100','请输入银行开户名|银行开户名称长度不能能超过50个字符'],
|
||||
['bankNo' ,'require','请输入对公结算银行账号'],
|
||||
['bankId' ,'require','请选择结算银行'],
|
||||
// ['bankAreaId' ,'require','请选择开户所地区'],
|
||||
['shopStatus' ,'in:-1,1','无效的店铺状态'],
|
||||
['statusDesc' ,'checkStatusDesc:1','请输入店铺停止原因']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['shopSn','shopName','shopCompany','shopkeeper','telephone','shopCompany','shopTel','isSelf','shopImg',
|
||||
'areaId','shopAddress','isInvoice','shopAtive','bankId','bankAreaId','bankNo','bankUserName','shopAtive'],
|
||||
'edit' => ['shopSn','shopName','shopCompany','shopkeeper','telephone','shopCompany','shopTel','isSelf','shopImg',
|
||||
'areaId','shopAddress','isInvoice','shopAtive','bankId','bankAreaId','bankNo','bankUserName','shopAtive']
|
||||
];
|
||||
|
||||
protected function checkShopSn($value){
|
||||
$shopId = Input('post.shopId/d',0);
|
||||
$key = Input('post.shopSn');
|
||||
if($shopId>0){
|
||||
if($key=='')return '请输入店铺编号';
|
||||
$isChk = model('Shops')->checkShopSn($key,$shopId);
|
||||
if($isChk)return '对不起,该店铺编号已存在';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function checkInvoiceRemark($value){
|
||||
$isInvoice = Input('post.isInvoice/d',0);
|
||||
$key = Input('post.invoiceRemarks');
|
||||
return ($isInvoice==1 && $key=='')?'请输入发票说明':true;
|
||||
}
|
||||
|
||||
protected function checkStatusDesc($value){
|
||||
$shopStatus = Input('post.shopStatus/d',0);
|
||||
$key = Input('post.statusDesc');
|
||||
return ($shopStatus==-1 && $key=='')?'请输入店铺停止原因':true;
|
||||
}
|
||||
}
|
20
hyhproject/admin/validate/SpecCats.php
Executable file
20
hyhproject/admin/validate/SpecCats.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 规格类型验证器
|
||||
*/
|
||||
class SpecCats extends Validate{
|
||||
protected $rule = [
|
||||
['catName|max:30', 'require', '请输入规格名称|规格名称不能超过10个字符'],
|
||||
['goodsCatId','require|gt:0', '请选择所属商品分类'],
|
||||
['isAllowImg','number|in:0,1', '请选择是否显示允许上传图片'],
|
||||
['isShow','require|in:0,1', '请选择是否显示']
|
||||
];
|
||||
protected $scene = [
|
||||
'add'=>['catName','goodsCatId','isAllowImg','isShow'],
|
||||
'edit'=>['catName','goodsCatId','isAllowImg','isShow']
|
||||
];
|
||||
|
||||
}
|
30
hyhproject/admin/validate/Staffs.php
Executable file
30
hyhproject/admin/validate/Staffs.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
use think\Db;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 职员验证器
|
||||
*/
|
||||
class Staffs extends Validate{
|
||||
protected $rule = [
|
||||
['loginName' ,'require|max:20|checkLoginName:1','请输入登录账号|登录账号不能超过20个字符'],
|
||||
['loginPwd' ,'require|min:6','请输入登录密码|登录密码不能少于6个字符'],
|
||||
['staffName' ,'require|max:60','请输入职员名称|职员名称不能超过20个字符'],
|
||||
['workStatus','require|in:0,1','请选择工作状态|无效的工作状态值'],
|
||||
['staffStatus','require|in:0,1','请选择账号状态|无效的账号状态值']
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['loginName','loginPwd','staffName','workStatus','staffStatus'],
|
||||
'edit' => ['staffName','workStatus','staffStatus']
|
||||
];
|
||||
|
||||
protected function checkLoginName($value){
|
||||
$where = [];
|
||||
$where['dataFlag'] = 1;
|
||||
$where['loginName'] = $value;
|
||||
$rs = Db::name('staffs')->where($where)->count();
|
||||
return ($rs==0)?true:'该登录账号已存在';
|
||||
}
|
||||
}
|
19
hyhproject/admin/validate/UserRanks.php
Executable file
19
hyhproject/admin/validate/UserRanks.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 会员级别验证器
|
||||
*/
|
||||
class UserRanks extends Validate{
|
||||
protected $rule = [
|
||||
['rankName' ,'require|max:30','请输入会员等级名称|会员等级名称不能超过10个字符'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['rankName'],
|
||||
'edit' => ['rankName'],
|
||||
];
|
||||
|
||||
|
||||
}
|
29
hyhproject/admin/validate/Users.php
Executable file
29
hyhproject/admin/validate/Users.php
Executable file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
use think\Db;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 会员验证器
|
||||
*/
|
||||
class Users extends Validate{
|
||||
protected $rule = [
|
||||
['loginName' ,'require|max:30|checkLoginName:1','请输入账号|账号不能超过10个字符'],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['loginName'],
|
||||
];
|
||||
|
||||
protected function checkLoginName($value){
|
||||
$where = [];
|
||||
$where['dataFlag'] = 1;
|
||||
$where['loginName'] = $value;
|
||||
if((int)input('userId')>0){
|
||||
$where['userId'] = ['<>',(int)input('post.userId')];
|
||||
}
|
||||
$rs = Db::name('users')->where($where)->count();
|
||||
return ($rs==0)?true:'该登录账号已存在';
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user