PayWayController.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\controller\setting\pay;
  15. use app\adminapi\controller\BaseAdminController;
  16. use app\adminapi\logic\setting\pay\PayWayLogic;
  17. /**
  18. * 支付方式
  19. * Class PayWayController
  20. * @package app\adminapi\controller\setting\pay
  21. */
  22. class PayWayController extends BaseAdminController
  23. {
  24. /**
  25. * @notes 获取支付方式
  26. * @return \think\response\Json
  27. * @throws \think\db\exception\DataNotFoundException
  28. * @throws \think\db\exception\DbException
  29. * @throws \think\db\exception\ModelNotFoundException
  30. * @author 段誉
  31. * @date 2023/2/23 16:27
  32. */
  33. public function getPayWay()
  34. {
  35. $result = PayWayLogic::getPayWay();
  36. return $this->success('获取成功',$result);
  37. }
  38. /**
  39. * @notes 设置支付方式
  40. * @return \think\response\Json
  41. * @throws \Exception
  42. * @author 段誉
  43. * @date 2023/2/23 16:27
  44. */
  45. public function setPayWay()
  46. {
  47. $params = $this->request->post();
  48. $result = (new PayWayLogic())->setPayWay($params);
  49. if (true !== $result) {
  50. return $this->fail($result);
  51. }
  52. return $this->success('操作成功',[],1, 1);
  53. }
  54. }