Beispiel #1
0
 /**
  * 用户中心的订单列表
  */
 public function orderlist()
 {
     $session = session('user');
     $user_id = 2;
     // $session['user_id'];
     $data['2cy_order.user_id'] = $user_id;
     if (empty($user_id)) {
         $this->assign('message', '请登录后再操作');
         $this->display('Public/error');
         exit;
     }
     $paytype = I('get.paytype');
     if ($paytype != null) {
         if ($paytype >= 0) {
             $data['2cy_order.order_type'] = $paytype;
         }
     }
     $orderModel = D('Order');
     $count = $orderModel->where($data)->count();
     $pageshowcount = 5;
     $Page = new Page($count, $pageshowcount);
     $show = $Page->pageshow();
     $orderList = $orderModel->field("2cy_order.user_id,2cy_order.order_type,2cy_order.auther,2cy_order.work_title,2cy_order.pay_money,2cy_order.money,2cy_order.order_id,2cy_order.order_number,2cy_order.create_date,works_comic.main_image_url,works_comic.tags_content")->join('left join works_comic on 2cy_order.work_id = works_comic.id')->order('create_date desc')->limit($Page->firstRow . ',' . $Page->listRows)->where($data)->select();
     $paytype = C('paystatus');
     $this->assign('orderList', $orderList);
     $this->assign('paytype', $paytype);
     $this->assign('order_type', $data['2cy_order.order_type']);
     $this->assign('show', $show);
     $this->display('orderlist');
 }