UserUserBrokerageServices.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\services\user;
  13. use app\services\BaseServices;
  14. use app\dao\user\UserUserBrokerageDao;
  15. /**
  16. * 用户关联佣金
  17. * Class UserUserBrokerageServices
  18. * @package app\services\user
  19. */
  20. class UserUserBrokerageServices extends BaseServices
  21. {
  22. /**
  23. * UserUserBrokerageServices constructor.
  24. * @param UserUserBrokerageDao $dao
  25. */
  26. public function __construct(UserUserBrokerageDao $dao)
  27. {
  28. $this->dao = $dao;
  29. }
  30. /**
  31. * 获取佣金列表
  32. * @param array $where
  33. * @param string $field
  34. * @param string $order
  35. * @param int $limit
  36. * @return array
  37. */
  38. public function getBrokerageList(array $where, string $field = '*', string $order = '', int $limit = 0)
  39. {
  40. if ($limit) {
  41. [$page] = $this->getPageValue();
  42. } else {
  43. [$page, $limit] = $this->getPageValue();
  44. }
  45. $list = $this->dao->getList($where, $field, $order, $page, $limit);
  46. $count = $this->dao->getCount($where);
  47. return [$count, $list];
  48. }
  49. }