ShopAccount.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的多应用管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\shop\site;
  12. use app\dict\shop\ShopAccountDict;
  13. use app\service\admin\shop\site\ShopAccountLogService;
  14. use app\service\admin\shop\site\ShopAccountService;
  15. use core\base\BaseAdminController;
  16. use think\Response;
  17. class ShopAccount extends BaseAdminController
  18. {
  19. /**
  20. * 账户信息
  21. * @return Response
  22. */
  23. public function info():Response
  24. {
  25. return success((new ShopAccountService())->getInfo());
  26. }
  27. public function lists()
  28. {
  29. $data = $this->request->params([
  30. ['from_type', ''],
  31. ['related_id', ''],
  32. ['create_time', []],
  33. ]);
  34. return success((new ShopAccountLogService())->getPage($data));
  35. }
  36. /**
  37. * 店铺申请状态
  38. * @return Response
  39. */
  40. public function getAccountType()
  41. {
  42. return success(ShopAccountDict::getType());
  43. }
  44. /**
  45. * 店铺收款方式编辑
  46. */
  47. public function setShopAccount()
  48. {
  49. $data = $this->request->params([
  50. ['bank_type', ''],
  51. ['bank_account_name', ''],
  52. ['bank_account_no', ''],
  53. ['bank_name', ''],
  54. ['bank_address', ''],
  55. ['alipay_name', ''],
  56. ['alipay_account_no', '']
  57. ]);
  58. ( new ShopAccountService() )->edit($data);
  59. return success('EDIT_SUCCESS');
  60. }
  61. /**
  62. * 检查店铺配置信息是否完善
  63. */
  64. public function checkAccountPayInfo()
  65. {
  66. $data = [];
  67. if (( new ShopAccountService() )->check()) {
  68. $data['is_fill'] = 1;
  69. } else {
  70. $data['is_fill'] = 0;
  71. }
  72. return success($data);
  73. }
  74. }