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.
 
 
 
 
 
 

108 lines
2.8 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 娄梦宁
  12. * PhpStorm OrderlistController.php
  13. * Create By 2016/11/11 10:23 $
  14. */
  15. namespace Order\Controller;
  16. use Base\Tool\LoginTool;
  17. use Order\Service\OrderlistService;
  18. use Util\Util\Util;
  19. class OrderlistController
  20. {
  21. private $service;
  22. /**
  23. * Function Description:
  24. * Function Name: getService
  25. *
  26. * @return OrderlistService
  27. *
  28. * @author 娄梦宁
  29. */
  30. public function getService()
  31. {
  32. if ($this->service == '') {
  33. $this->service = new OrderlistService();
  34. }
  35. return $this->service;
  36. }
  37. /**
  38. * Function Description:订单列表
  39. * Function Name: indexAction
  40. *
  41. * @return string
  42. *
  43. * @author 娄梦宁
  44. */
  45. public function indexAction()
  46. {
  47. $checkLogin = LoginTool::checkLogin();//校验用户登录状态
  48. if ($checkLogin['flag'] == false) {
  49. return json_encode($checkLogin);
  50. }
  51. $result = $this->getService()->getmyorder();
  52. if ($result['flag'] == true) {
  53. return json_encode($result);
  54. }
  55. return Util::returnJsEr('未获取到符合条件的数据');
  56. }
  57. /**
  58. * Function Description:订单详情
  59. * Function Name: getDetaileAction
  60. *
  61. * @return string
  62. *
  63. * @author 娄梦宁
  64. */
  65. public function getDetaileAction()
  66. {
  67. if($_POST['code']==md5('zhizhuchuxing')){
  68. }else{
  69. $checkLogin = LoginTool::checkLogin();//校验用户登录状态
  70. if($checkLogin['flag'] == false) {
  71. return json_encode($checkLogin);
  72. }
  73. }
  74. if ($_POST['order_id']) {
  75. $result = $this->getService()->getOrder($_POST['order_id']);
  76. return json_encode($result);
  77. }
  78. return Util::returnJsEr('未获取到符合条件的数据');
  79. }
  80. /**
  81. * Function Description:取消订单
  82. * Function Name: cancelAction
  83. *
  84. * @return string
  85. *
  86. * @author 娄梦宁
  87. */
  88. public function cancelAction()
  89. {
  90. $userId = LoginTool::$userId;
  91. if (Util::checkPattern('intVal', $_POST['pro_id']) && $userId) {
  92. $result = $this->getService()->cancelticket($_POST['order_id'], $userId);
  93. return json_encode($result);
  94. }
  95. return Util::returnJsEr('参数错误');
  96. }
  97. }