海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
3.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\Admin\Forms;
  3. use Dcat\Admin\Widgets\Form;
  4. class Setting extends Form
  5. {
  6. /**
  7. * Handle the form request.
  8. *
  9. * @param array $input
  10. *
  11. * @return mixed
  12. */
  13. public function handle(array $input)
  14. {
  15. // dump($input);
  16. // return $this->response()->error('Your error message.');
  17. admin_setting($input);
  18. return $this->response()->success('保存成功')->refresh();
  19. }
  20. /**
  21. * Build a form here.
  22. */
  23. public function form()
  24. {
  25. $this->tab('入驻配置', function () {
  26. //供应商
  27. $this->decimal('settled_supplier_cost', '供应商入驻费(元)')
  28. ->rules('numeric|min:0', ['*' => '请输入正确的金额'])->default(0)->required();
  29. $this->file('settled_supplier_contract', '供应商入驻合同')->uniqueName()->autoUpload()->required()
  30. ->help('建议为doc/docx/pdf格式,供应商可在入驻页面下载后打印');
  31. $this->file('settled_supplier_agreement', '供应商入驻协议')->uniqueName()->autoUpload()->required()
  32. ->help('建议为doc/docx/pdf格式,供应商可在入驻页面下载后查看');
  33. //代理商
  34. $this->divider();
  35. $this->decimal('settled_agent_cost', '代理商入驻费(元)')
  36. ->rules('numeric|min:0', ['*' => '请输入正确的金额'])->default(0)->required();
  37. $this->file('settled_agent_contract', '代理商入驻合同')->uniqueName()->autoUpload()->required()
  38. ->help('建议为doc/docx/pdf格式,代理商可在入驻页面下载后打印');
  39. $this->file('settled_agent_agreement', '代理商入驻协议')->uniqueName()->autoUpload()->required()
  40. ->help('建议为doc/docx/pdf格式,代理商可在入驻页面下载后查看');
  41. //地接
  42. $this->divider();
  43. $this->decimal('settled_guide_cost', '地接入驻费(元)')
  44. ->rules('numeric|min:0', ['*' => '请输入正确的金额'])->default(0)->required();
  45. $this->file('settled_guide_contract', '地接入驻合同')->uniqueName()->autoUpload()->required()
  46. ->help('建议为doc/docx/pdf格式,地接可在入驻页面下载后打印');
  47. $this->file('settled_guide_agreement', '地接入驻协议')->uniqueName()->autoUpload()->required()
  48. ->help('建议为doc/docx/pdf格式,地接可在入驻页面下载后查看');
  49. })->tab('支付小程序配置', function () {
  50. $this->text('payee_appid', '收款小程序APPID')->required();
  51. $this->text('payee_appsecret', '收款小程序APP_SECRET')->required();
  52. $this->text('payee_mchid', '收款小程序MCH_ID')->required();
  53. $this->text('payee_mchkey', '收款小程序MCH_KEY')->required();
  54. })->tab('小程序服务商配置', function () {
  55. $this->text('service_appid', '小程序第三方平台APPID')->required();
  56. $this->text('service_appsecret', '小程序第三方平台APP_SECRET')->required();
  57. $this->text('service_token', '消息校验Token')->help('跟小程序管理后台的一致,请勿随意更改')->required();
  58. $this->text('service_aeskey', '消息加解密Key')->help('跟小程序管理后台的一致,请勿随意更改')->required();
  59. $this->text('service_component_phone', '联系电话')->help('为代理商注册小程序时,腾讯下发注册认证信息时,代理商会看到此电话')->required();
  60. });
  61. }
  62. /**
  63. * The data of the form.
  64. *
  65. * @return array
  66. */
  67. public function default()
  68. {
  69. return admin_setting()->toArray();
  70. }
  71. }