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.
 
 
 
 
 
 

89 lines
2.5 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 倪宗锋
  12. * PhpStorm OrderController.php
  13. * Create By 2017/7/3 18:49 $
  14. */
  15. namespace zzcx\controllers\user;
  16. use common\Controller\ZzcxController;
  17. use common\service\login\LoginService;
  18. use common\util\Util;
  19. use zzcx\service\user\Order;
  20. class OrderController extends ZzcxController
  21. {
  22. private $service = null;
  23. public function service()
  24. {
  25. if ($this->service == null) {
  26. $this->service = new Order();
  27. }
  28. return $this->service;
  29. }
  30. /**
  31. * Des:获取用户的订单列表
  32. * Name: actionGetList
  33. * @return string
  34. * @author 倪宗锋
  35. */
  36. public function actionGetList()
  37. {
  38. $params = [
  39. 'order_status' => $this->_post('order_status', ''),
  40. 'current_page' => $this->_post('current_page', 1),
  41. 'page_size' => $this->_post('page_size', 10),
  42. 'sh_uid' => LoginService::$uid
  43. ];
  44. if ($params['order_status'] == '5') {
  45. $params['order_status'] = '4,5,6';
  46. }
  47. $getList = $this->service()->getList($params);
  48. return Util::returnJsSu('', $getList['data']);
  49. }
  50. /**
  51. * Des:获取订单详情
  52. * Name: actionGetOrderInfo
  53. * @return string
  54. * @author 倪宗锋
  55. */
  56. public function actionGetOrderInfo()
  57. {
  58. $order_id = $this->_post('order_id', '');
  59. $getInfo = $this->service()->getOrderInfo($order_id);
  60. if ($getInfo['flag'] == false) {
  61. return Util::returnJsEr($getInfo['msg']);
  62. }
  63. return Util::returnJsSu('', $getInfo['data']);
  64. }
  65. /**
  66. * Des:取消订单
  67. * Name: actionCancel
  68. * @return string
  69. * @author 倪宗锋
  70. */
  71. public function actionCancel()
  72. {
  73. $order_id = $this->_post('order_id', '');
  74. $getInfo = $this->service()->cancel($order_id);
  75. if ($getInfo['flag'] == false) {
  76. return Util::returnJsEr($getInfo['msg']);
  77. }
  78. return Util::returnJsSu();
  79. }
  80. }