Example #1
0
 /**
  * 订单列表
  */
 public function actionorderlist()
 {
     $ret = array('status' => 0, 'mag' => '');
     $brandid = isset($_SESSION['brandid']) ? $_SESSION['brandid'] : 0;
     $page = 1;
     $pagecount = 20;
     $keyword = "";
     $startdate = "";
     $dateorder = "desc";
     $type = "1";
     $havedata = 0;
     if (Yii::app()->request->getParam('keyword')) {
         $keyword = Yii::app()->request->getParam('keyword');
         $arr['key'] = $keyword;
     }
     if (Yii::app()->request->getParam('startdate')) {
         $startdate = Yii::app()->request->getParam('startdate');
         $arr['strd_data'] = $startdate;
     }
     if (Yii::app()->request->getParam('enddate')) {
         $enddate = Yii::app()->request->getParam('enddate');
         $arr['end_data'] = $enddate;
     }
     if (Yii::app()->request->getParam('dateorder')) {
         $dateorder = Yii::app()->request->getParam('dateorder');
         //时间排序
         $arr['dateorder'] = $dateorder;
     }
     if (Yii::app()->request->getParam('type')) {
         $type = Yii::app()->request->getParam('type');
         //时间排序
         $arr['type'] = $type;
     }
     $arr['brandid'] = $brandid;
     if (Yii::app()->request->getParam('page')) {
         $page = Yii::app()->request->getParam('page');
     }
     $data = array();
     //通过条件查询订单表
     $orderobj = orderclass::select_all_order($page, $pagecount, $brandid, $arr);
     if ($orderobj['status'] != 0) {
         $data = $orderobj['data'];
         $orderlist = $data['data'];
         for ($i = 0; $i < count($orderlist); $i++) {
             $orderlist[$i]['haveimage'] = 1;
             //1为不显示
             $array = array('orderid' => $orderlist[$i]['id']);
             $clothesorderclass = new clothesorderclass();
             $orderclothes = $clothesorderclass->select_Single_clothes($brandid, $array);
             if (empty($orderclothes)) {
                 $orderlist[$i]['haveimage'] = 0;
                 //0为显示
             }
         }
         $data['data'] = $orderlist;
     }
     $datearray = orderclass::select_order_date($brandid);
     $prme_arr = array('data' => $data, 'brandid' => $brandid, 'strd_data' => $startdate, 'end_data' => $enddate, 'dateorder' => $dateorder, 'key' => $keyword, 'type' => $type, 'datearray' => $datearray);
     $this->render('orderlist', $prme_arr);
 }