| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- // +----------------------------------------------------------------------
- // | saiadmin [ saiadmin快速开发框架 ]
- // +----------------------------------------------------------------------
- namespace plugin\saiadmin\app\validate\miniProgram;
- use plugin\saiadmin\basic\BaseValidate;
- /**
- * 微信公众号配置验证器
- */
- class WechatOfficialAccountValidate extends BaseValidate
- {
- protected $rule = [
- 'logo' => 'max:500',
- 'account_name' => 'require|max:64',
- 'description' => 'max:255',
- 'follow_message' => 'max:255',
- 'follow_url' => 'max:500',
- 'follow_enabled' => 'in:0,1',
- 'appid' => 'require|max:64',
- 'original_id' => 'require|max:64',
- 'appsecret' => 'require|max:128',
- 'server_url' => 'require|max:500',
- 'token' => 'require|max:128',
- 'encoding_aes_key' => 'max:128',
- 'encryption_mode' => 'in:1,2,3',
- 'free_recharge_times' => 'integer|between:0,999999',
- 'follow_free_recharge' => 'in:0,1',
- 'all_merchant_follow' => 'in:0,1',
- ];
- protected $message = [
- 'account_name' => '请填写正确的公众号名称',
- 'appid' => '请填写正确的公众号 APPID',
- 'original_id' => '请填写正确的公众号原始 ID',
- 'appsecret' => '请填写正确的公众号 AppSecret',
- 'server_url' => '请填写正确的服务器地址',
- 'token' => '请填写正确的令牌',
- 'encryption_mode' => '请选择正确的加密模式',
- 'free_recharge_times' => '免费充值次数必须是 0 至 999999 的整数',
- 'follow_enabled' => '关注开启状态不正确',
- 'follow_free_recharge' => '关注免费充值状态不正确',
- 'all_merchant_follow' => '所有商户关注状态不正确',
- ];
- protected $scene = [
- 'update' => [
- 'logo', 'account_name', 'description', 'follow_message', 'follow_url',
- 'follow_enabled', 'appid', 'original_id', 'appsecret', 'server_url', 'token',
- 'encoding_aes_key', 'encryption_mode', 'free_recharge_times',
- 'follow_free_recharge', 'all_merchant_follow',
- ],
- ];
- }
|