Visit.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\logic\visitlogic;
  4. use think\Controller;
  5. /**
  6. * 到访
  7. *
  8. * @author wj
  9. * @date 2023-01-18
  10. */
  11. class Visit extends Controller
  12. {
  13. public function newinfo()
  14. {
  15. $post = request()->post();
  16. $l_v = new visitlogic();
  17. $result = $l_v->newinfo($post);
  18. if (empty($result['status'])) {
  19. return backjson2(0, $result['msg']);
  20. }
  21. return backjson2(200, $result['msg'], $result['data']);
  22. }
  23. public function getlist()
  24. {
  25. $post = request()->post();
  26. $l_v = new visitlogic();
  27. $result = $l_v->getlist($post);
  28. if (empty($result['status'])) {
  29. return backjson2(0, $result['msg']);
  30. }
  31. return backjson2(200, $result['msg'], $result['data']);
  32. }
  33. public function getbusinesstyoelist()
  34. {
  35. $post = request()->post();
  36. $l_v = new visitlogic();
  37. $result = $l_v->getbusinesstyoelist($post);
  38. if (empty($result['status'])) {
  39. return backjson2(0, $result['msg']);
  40. }
  41. return backjson2(200, $result['msg'], $result['data']);
  42. }
  43. /**
  44. * 导出列表
  45. *
  46. * @return void
  47. * @author wj
  48. * @date 2023-01-30
  49. */
  50. public function exportlist()
  51. {
  52. $l_v = new visitlogic();
  53. $post = request()->post();
  54. if (request()->isPost()) {
  55. $post = request()->post();
  56. $result = $l_v->checkexportlist($post);
  57. if (empty($result['status'])) {
  58. return backjson2(0, $result['msg']);
  59. }
  60. return backjson2(200, $result['msg'], $result['data']);
  61. }
  62. if (request()->isGet()) {
  63. $result = $l_v->doexportlist();
  64. if (is_array($result) && empty($result['status'])) {
  65. return $this->error($result['msg']);
  66. }
  67. return backjson2(200, $result['msg']);
  68. }
  69. }
  70. }