| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Module\Transfer\Validations;
- use UCore\ValidationCore;
- /**
- * 第三方应用转出验证类
- * 专门为第三方应用提取请求设计,跳过密码验证
- */
- class TransferOutThirdPartyValidation extends ValidationCore
- {
- /** @var \App\Module\Transfer\Models\TransferApp|null 转账应用对象,由验证器设置 */
- public ?\App\Module\Transfer\Models\TransferApp $transfer_app = null;
- /**
- * 验证规则
- */
- public function rules($rules = []): array
- {
- return [
- // 基础验证
- ['transfer_app_id,user_id', 'required'],
- ['transfer_app_id,user_id', 'integer', 'min' => 1],
- ['amount', 'required'],
- // 注意:这里不要求password字段,因为第三方应用不需要密码验证
- ['google_code', 'string', 'size' => 6],
- ['out_user_id', 'string', 'max' => 50],
- ['remark', 'string', 'max' => 255],
- ['callback_data', 'array'],
- ];
- }
- /**
- * 默认值
- */
- public function default(): array
- {
- return [];
- }
- }
|