You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
1.3 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 娄梦宁
  12. * PhpStorm AroundController.php
  13. * Create By 2016/11/10 13:23 $
  14. */
  15. namespace Trip\Controller;
  16. use Trip\Service\TripService;
  17. class TripController
  18. {
  19. private $service;
  20. /**
  21. * Function Description:获取service
  22. * Function Name: getService
  23. *
  24. * @return TripService
  25. *
  26. * @author 娄梦宁
  27. */
  28. public function getService(){
  29. if($this->service == '') {
  30. $this->service = new TripService();
  31. }
  32. return $this->service;
  33. }
  34. /**
  35. * Function Description:所有初始化数据
  36. * Function Name: indexAction
  37. *
  38. * @return string
  39. *
  40. * @author 娄梦宁
  41. */
  42. public function indexAction(){
  43. //获取所有数据
  44. $reComList=$this->getService()->getAll();
  45. return json_encode($reComList);
  46. }
  47. }