StoreService.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\admin\store;
  12. use think\App;
  13. use crmeb\basic\BaseController;
  14. use app\common\repositories\store\service\StoreServiceLogRepository;
  15. use app\common\repositories\store\service\StoreServiceRepository;
  16. /**
  17. * 客服
  18. */
  19. class StoreService extends BaseController
  20. {
  21. /**
  22. * @var StoreServiceRepository
  23. */
  24. protected $repository;
  25. /**
  26. * @var StoreServiceLogRepository
  27. */
  28. protected $logRepository;
  29. /**
  30. * StoreService constructor.
  31. * @param App $app
  32. * @param StoreServiceRepository $repository
  33. */
  34. public function __construct(App $app, StoreServiceRepository $repository, StoreServiceLogRepository $logRepository)
  35. {
  36. parent::__construct($app);
  37. $this->repository = $repository;
  38. $this->logRepository = $logRepository;
  39. }
  40. /**
  41. * 列表
  42. * @param $id
  43. * @return mixed
  44. * @author Qinii
  45. * @day 2020-06-19
  46. */
  47. public function lst($id)
  48. {
  49. $where = $this->request->params(['keyword', 'status']);
  50. [$page, $limit] = $this->getPage();
  51. $where['mer_id'] = $id;
  52. return app('json')->success($this->repository->getList($where, $page, $limit));
  53. }
  54. /**
  55. * 某个用户与商户聊天记录
  56. * @param $uid
  57. * @param $id
  58. * @return mixed
  59. * @author Qinii
  60. * @day 2020-06-19
  61. */
  62. public function getUserMsnByMerchant($uid, $id)
  63. {
  64. [$page, $limit] = $this->getPage();
  65. return app('json')->success($this->logRepository->getUserMsn($uid, $page, $limit, $id));
  66. }
  67. /**
  68. * 某个客服的聊天用户列表
  69. * @param $id
  70. * @return mixed
  71. * @author Qinii
  72. * @day 2020-06-19
  73. */
  74. public function merchantUserList($id)
  75. {
  76. [$page, $limit] = $this->getPage();
  77. return app('json')->success($this->logRepository->getMerchantUserList($id, $page, $limit));
  78. }
  79. }