UserUserBrokerageServices.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 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. * @mixin UserUserBrokerageDao
  20. */
  21. class UserUserBrokerageServices extends BaseServices
  22. {
  23. /**
  24. * UserUserBrokerageServices constructor.
  25. * @param UserUserBrokerageDao $dao
  26. */
  27. public function __construct(UserUserBrokerageDao $dao)
  28. {
  29. $this->dao = $dao;
  30. }
  31. /**
  32. * 获取佣金列表
  33. * @param array $where
  34. * @param string $field
  35. * @param string $order
  36. * @param int $limit
  37. * @return array
  38. */
  39. public function getBrokerageList(array $where, string $field = '*', string $order = '', int $limit = 0)
  40. {
  41. if ($limit) {
  42. [$page] = $this->getPageValue();
  43. } else {
  44. [$page, $limit] = $this->getPageValue();
  45. }
  46. $list = $this->dao->getList($where, $field, $order, $page, $limit);
  47. $count = $this->dao->getCount($where);
  48. return [$count, $list];
  49. }
  50. }