FollowController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\wechat\controller;
  3. use app\wechat\IndexController;
  4. use app\wechat\service\FollowService;
  5. use app\wechat\validate\FollowValidate;
  6. use support\Request;
  7. class FollowController extends IndexController
  8. {
  9. public function __construct()
  10. {
  11. $this->validateClass = new FollowValidate();
  12. }
  13. /**
  14. * Notes: 添加跟进记录
  15. * User: yb
  16. * Date: 2024/8/13
  17. * Time: 11:25
  18. * @param Request $request
  19. */
  20. public function addFollow(Request $request)
  21. {
  22. $params = $request->post();
  23. if (!$this->validateClass->check($params)) {
  24. return json_fail($this->validateClass->getError());
  25. }
  26. return FollowService::add($params);
  27. }
  28. /**
  29. * Notes: 跟进记录列表
  30. * User: yb
  31. * Date: 2024/8/13
  32. * Time: 15:55
  33. * @param Request $request
  34. */
  35. public function followList(Request $request)
  36. {
  37. $params = $request->post();
  38. return FollowService::index($params);
  39. }
  40. /**
  41. * Notes: 跟进记录详情
  42. * User: yb
  43. * Date: 2024/8/13
  44. * Time: 17:00
  45. * @param Request $request
  46. * @return \support\Response
  47. */
  48. public function followInfo(Request $request)
  49. {
  50. $params = $request->post();
  51. if (empty($params['id'])) {
  52. return json_fail('跟进记录id不能为空');
  53. }
  54. return FollowService::info($params['id']);
  55. }
  56. }