Invoice.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;/**
  4. * ============================================================================
  5. * DSMall多用户商城
  6. * ============================================================================
  7. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  8. * 网站地址: http://www.csdeshang.com
  9. * ----------------------------------------------------------------------------
  10. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  11. * 不允许对程序代码以任何形式任何目的的再发布。
  12. * ============================================================================
  13. * 验证器
  14. */
  15. class Invoice extends Validate
  16. {
  17. protected $rule = [
  18. 'invoice_state'=>'require|in:1,2',
  19. 'invoice_title'=>'require|max:50',
  20. 'invoice_content'=>'require|max:10',
  21. 'invoice_code'=>'require|max:50',
  22. 'invoice_company'=>'require|max:50',
  23. 'invoice_company_code'=>'require|max:50',
  24. 'invoice_reg_addr'=>'require|max:50',
  25. 'invoice_reg_phone'=>'require|max:30',
  26. 'invoice_reg_bname'=>'require|max:30',
  27. 'invoice_reg_baccount'=>'require|max:30',
  28. ];
  29. protected $message = [
  30. 'invoice_state.require'=>'发票类型必填',
  31. 'invoice_state.in'=>'发票类型错误',
  32. 'invoice_title.require'=>'发票抬头必填',
  33. 'invoice_title.max'=>'发票抬头长度必须小于50',
  34. 'invoice_content.require'=>'发票内容必填',
  35. 'invoice_content.max'=>'发票内容长度必须小于10',
  36. 'invoice_code.require'=>'纳税人识别号必填',
  37. 'invoice_code.max'=>'纳税人识别号长度必须小于50',
  38. 'invoice_company.require'=>'单位名称必填',
  39. 'invoice_company.max'=>'单位名称长度必须小于50',
  40. 'invoice_company_code.require'=>'纳税人识别号必填',
  41. 'invoice_company_code.max'=>'纳税人识别号长度必须小于50',
  42. 'invoice_reg_addr.require'=>'注册地址必填',
  43. 'invoice_reg_addr.max'=>'注册地址长度必须小于50',
  44. 'invoice_reg_phone.require'=>'注册电话必填',
  45. 'invoice_reg_phone.max'=>'注册电话长度必须小于30',
  46. 'invoice_reg_bname.require'=>'开户银行必填',
  47. 'invoice_reg_bname.max'=>'开户银行长度必须小于30',
  48. 'invoice_reg_baccount.require'=>'银行帐户必填',
  49. 'invoice_reg_baccount.max'=>'银行帐户长度必须小于30',
  50. ];
  51. protected $scene = [
  52. 'invoice_1_update' => ['invoice_state', 'invoice_title', 'invoice_content', 'invoice_code'],
  53. 'invoice_2_update' => ['invoice_company', 'invoice_company_code', 'invoice_reg_addr', 'invoice_reg_phone', 'invoice_reg_bname', 'invoice_reg_baccount'],
  54. ];
  55. }