ComplaintConsultantService.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: wuzhenke
  5. * Date: 2018/11/13
  6. * Time: 17:44
  7. */
  8. namespace App\Services\Company;
  9. use App\Exceptions\ResponseException;
  10. use App\Repositories\CompanyRepository;
  11. use App\Repositories\ComplaintConsultantRepository;
  12. use App\Repositories\MemberLogRepository;
  13. class ComplaintConsultantService
  14. {
  15. protected $companyRepository;
  16. protected $memberLogRepository;
  17. protected $complaintConsultantRepository;
  18. /**
  19. * CompanyImgService constructor.
  20. * @param $companyImgRepository
  21. * @param $companyRepository
  22. * @param $taskService
  23. * @param $memberLogRepository
  24. */
  25. public function __construct(MemberLogRepository $memberLogRepository, CompanyRepository $companyRepository, ComplaintConsultantRepository $complaintConsultantRepository)
  26. {
  27. $this->companyRepository = $companyRepository;
  28. $this->memberLogRepository = $memberLogRepository;
  29. $this->complaintConsultantRepository = $complaintConsultantRepository;
  30. }
  31. public function getCompanyConsultant($user, $input)
  32. {
  33. $id = $input['id'];
  34. $notes = $input['notes'];
  35. if(empty($id)){
  36. throw new ResponseException('专属客服不存在!');
  37. }
  38. if(empty($notes)){
  39. throw new ResponseException('投诉说明不能为空!');
  40. }
  41. return $this->complaintConsultantRepository->addData(['uid'=>$user->id,'consultant_id'=>$id,'notes'=>$notes]);
  42. }
  43. }