Shop.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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\ShopService;
  15. use core\base\BaseAdminController;
  16. use think\Response;
  17. class Shop extends BaseAdminController
  18. {
  19. /**
  20. * 店铺资产概况
  21. * @return Response
  22. */
  23. public function accountInfo():Response
  24. {
  25. return success((new ShopService())->getAccountInfo());
  26. }
  27. /**
  28. * 店铺账单记录
  29. * @return Response
  30. */
  31. public function accountLists()
  32. {
  33. $data = $this->request->params([
  34. ['from_type', ''],
  35. ['related_id', ''],
  36. ['create_time', []],
  37. ]);
  38. return success((new ShopAccountLogService())->getPage($data));
  39. }
  40. /**
  41. * 店铺账单类型
  42. * @return Response
  43. */
  44. public function getAccountType()
  45. {
  46. return success(ShopAccountDict::getType());
  47. }
  48. /**
  49. * 店铺收款方式编辑
  50. */
  51. public function setShopAccount()
  52. {
  53. $data = $this->request->params([
  54. ['bank_type', ''],
  55. ['bank_account_name', ''],
  56. ['bank_account_no', ''],
  57. ['bank_name', ''],
  58. ['bank_address', ''],
  59. ['alipay_name', ''],
  60. ['alipay_account_no', ''],
  61. ['alipay_payment_code', ''],
  62. ['wechat_name', ''],
  63. ['wechat_account_no', ''],
  64. ['wechat_payment_code', ''],
  65. ]);
  66. ( new ShopService() )->edit($data);
  67. return success('EDIT_SUCCESS');
  68. }
  69. /**
  70. * 检查店铺配置信息是否完善
  71. */
  72. public function checkAccountPayInfo()
  73. {
  74. $data = [];
  75. if (( new ShopService() )->check()) {
  76. $data['is_fill'] = 1;
  77. } else {
  78. $data['is_fill'] = 0;
  79. }
  80. return success($data);
  81. }
  82. }