StoreCouponIssueUserServices.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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\activity\coupon;
  13. use app\services\BaseServices;
  14. use app\dao\activity\coupon\StoreCouponIssueUserDao;
  15. /**
  16. * Class StoreCouponIssueUserServices
  17. * @package app\services\coupon
  18. * @method getColumn(array $where, string $field, ?string $key = '')
  19. * @method delIssueUserCoupon(array $where)
  20. */
  21. class StoreCouponIssueUserServices extends BaseServices
  22. {
  23. /**
  24. * StoreCouponIssueUserServices constructor.
  25. * @param StoreCouponIssueUserDao $dao
  26. */
  27. public function __construct(StoreCouponIssueUserDao $dao)
  28. {
  29. $this->dao = $dao;
  30. }
  31. /**
  32. * 获取列表
  33. * @param array $where
  34. * @return array
  35. */
  36. public function issueLog(array $where)
  37. {
  38. [$page, $limit] = $this->getPageValue();
  39. $list = $this->dao->getList($where, $page, $limit);
  40. $site_url = sys_config('site_url');
  41. foreach ($list as &$item) {
  42. $item['avatar'] = strpos($item['avatar'], 'http') === false ? ($site_url . $item['avatar']) : $item['avatar'];
  43. }
  44. $count = $this->dao->count($where);
  45. return compact('list', 'count');
  46. }
  47. }