Order.php 810 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\index\controller\cms;
  3. use app\common\controller\Frontend;
  4. /**
  5. * 我的消费订单
  6. */
  7. class Order extends Frontend
  8. {
  9. protected $layout = 'default';
  10. protected $noNeedLogin = [];
  11. protected $noNeedRight = ['*'];
  12. /**
  13. * 我的消费订单
  14. */
  15. public function index()
  16. {
  17. $user_id = $this->auth->id;
  18. $orderList = \addons\cms\model\Order::with(['archives'])->where('user_id', $user_id)
  19. ->where('status', 'paid')
  20. ->order('id', 'desc')
  21. ->paginate(10, null);
  22. $this->view->assign('config', array_merge($this->view->config, ['jsname' => '']));
  23. $this->view->assign('orderList', $orderList);
  24. $this->view->assign('title', '我的消费订单');
  25. return $this->view->fetch();
  26. }
  27. }