| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- // +----------------------------------------------------------------------
- // |
- // +----------------------------------------------------------------------
- // |
- // +----------------------------------------------------------------------
- // |
- // +----------------------------------------------------------------------
- // |
- // +----------------------------------------------------------------------
- // +----------------------------------------------------------------------
- // | 订单管理
- // +----------------------------------------------------------------------
- namespace app\index\controller\cms;
- use addons\cms\model\Order as OrderModel;
- use app\common\controller\Frontend;
- class Order extends Frontend
- {
- protected $noNeedLogin = [];
- protected $noNeedRight = ['*'];
- //订单列表
- public function index()
- {
- if ($this->request->isAjax()) {
- $limit = $this->request->param('limit/d', 10);
- $page = $this->request->param('page/d', 1);
- $_list = OrderModel::where('user_id', $this->auth->id)->page($page, $limit)->order('id DESC')->select();
- $total = OrderModel::where('user_id', $this->auth->id)->count();
- $result = ["code" => 0, "count" => $total, "data" => $_list];
- return json($result);
- } else {
- $this->assign('title', '订单记录');
- return $this->fetch('order_list');
- }
- }
- }
|