PayConfigLists.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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\lists\setting\pay;
  15. use app\adminapi\lists\BaseAdminDataLists;
  16. use app\common\model\pay\PayConfig;
  17. /**
  18. * 支付配置列表
  19. * Class PayConfigLists
  20. * @package app\adminapi\lists\setting\pay
  21. */
  22. class PayConfigLists extends BaseAdminDataLists
  23. {
  24. /**
  25. * @notes 获取列表
  26. * @return array
  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:15
  32. */
  33. public function lists(): array
  34. {
  35. $lists = PayConfig::field('id,name,pay_way,icon,sort')
  36. ->append(['pay_way_name'])
  37. ->order('sort','desc')
  38. ->select()
  39. ->toArray();
  40. return $lists;
  41. }
  42. /**
  43. * @notes 获取数量
  44. * @return int
  45. * @author 段誉
  46. * @date 2023/2/23 16:15
  47. */
  48. public function count(): int
  49. {
  50. return PayConfig::count();
  51. }
  52. }