UserServices.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\services\cashier;
  12. use app\services\BaseServices;
  13. use app\services\user\UserWechatuserServices;
  14. /**
  15. * 收银台用户Services
  16. */
  17. class UserServices extends BaseServices
  18. {
  19. protected $userType = [
  20. 'wechat' => '公众号',
  21. 'routine' => '小程序',
  22. 'h5' => 'H5',
  23. 'pc' => 'PC',
  24. 'app' => 'APP'
  25. ];
  26. /**
  27. * 收银台选择用户列表
  28. * @param array $where
  29. * @return array
  30. */
  31. public function getUserList(array $where)
  32. {
  33. /** @var UserWechatuserServices $services */
  34. $services = app()->make(UserWechatuserServices::class);
  35. [$list, $count] = $services->getWhereUserList($where, 'u.uid,avatar,u.nickname,phone,u.user_type,now_money,integral');
  36. foreach ($list as &$item) {
  37. $item['user_type'] = $this->userType[$item['user_type']] ?? '其他';
  38. }
  39. return compact('list', 'count');
  40. }
  41. }