コード例 #1
0
 /**
  * 订单列表
  */
 public function actionIndex()
 {
     $pageIndex = isset($_GET['page']) ? $_GET['page'] : 1;
     $view = isset($_GET['view']) ? $_GET['view'] : 0;
     $conditionArr = array();
     //待发货 pay_status:1;ship_status:0
     if ($view == 0) {
         $conditionArr = array('pay_status' => 1, 'ship_status' => 0);
     }
     //已发货 ship_status:1
     if ($view == 1) {
         $conditionArr = array('ship_status' => 1);
     }
     //待支付 pay_status:0
     if ($view == 2) {
         $conditionArr = array('pay_status' => 0);
     }
     //已支付到担保方 pay_status:2
     if ($view == 3) {
         $conditionArr = array('pay_status' => 2);
     }
     //已支付 pay_status:1
     if ($view == 4) {
         $conditionArr = array('pay_status' => 1);
     }
     //货到付款
     if ($view == 5) {
         $conditionArr = array('pay_status' => 10);
     }
     //活动 status:active
     if ($view == 6) {
         $conditionArr = array('status' => 'active', 'pay_status' => 0);
     }
     //已作废 status:dead
     if ($view == 7) {
         $conditionArr = array('status' => 'dead');
     }
     //已完成 status:finish
     if ($view == 8) {
         $conditionArr = array('status' => 'finish');
     }
     //全部
     if ($view == 9) {
         $conditionArr = array();
     }
     $Order = new Orders();
     $result = $Order->orderList($conditionArr, $pageIndex, $this->pagesize);
     $order_list = array();
     foreach ($result['items'] as $k => $v) {
         $order_list[$k] = $v;
         $order_list[$k]['pay_status_name'] = Params::PayStatus($v['pay_status']);
         $order_list[$k]['ship_status_name'] = Params::ShipStatus($v['ship_status']);
         $order_list[$k]['member_name'] = Params::PamMember($v['member_id']);
     }
     //分页
     $pages = new CPagination($result['count']);
     $this->render('index', array('dataProvider' => $order_list, 'view' => $view, 'pages' => $pages, 'pageIndex' => $pageIndex - 1));
 }
コード例 #2
0
 /**
  * 基本信息
  */
 public function actionBase()
 {
     $order_id = $_POST['order_id'];
     $act = isset($_POST['act']) ? $_POST['act'] : '';
     $order_info = Orders::model()->find('order_id = :order_id', array(':order_id' => $order_id));
     //支付详情
     $OrderBills = new OrderBills();
     $payment_info = $OrderBills->OrderPayment($order_id, true);
     //会员信息
     $user_name = Params::PamMember($order_info->member_id);
     $user_info = Params::Member($order_info->member_id);
     $user_info_addon = unserialize($user_info['addon']);
     //商品信息
     $product_list = OrderItems::model()->findAll('order_id = :order_id', array(':order_id' => $order_id));
     if (empty($act)) {
         $view = 'base';
     } else {
         $view = '_order_base';
     }
     echo $this->renderPartial($view, array('order_id' => $order_id, 'order_info' => $order_info, 'payment_info' => $payment_info, 'user_name' => $user_name, 'user_info' => $user_info, 'user_info_addon' => $user_info_addon, 'product_list' => $product_list), true);
 }