Exemplo n.º 1
0
 public function indexAction()
 {
     $view = new MainView();
     $modelOrder = new OrderModel();
     $model = new PhoneModel();
     $phones = $model->getPhones();
     return $this->_controller->setPage($view->showMain(['count' => $modelOrder->getCount(), 'phones' => $phones]));
 }
 public function getlist5()
 {
     $where = " other!=''";
     $page = 1;
     $size = 15;
     if (!empty($_GET)) {
         if ($_GET['page'] != "") {
             $page = $_GET['page'];
         }
         if ($_GET['start_time'] != "" && $_GET['start_time'] != "开始日期") {
             $where .= " and time >= '" . $_GET['start_time'] . "'";
         }
         if ($_GET['end_time'] != "" && $_GET['end_time'] != "截止日期") {
             $where .= " and time <= '" . $_GET['end_time'] . " 23:59:59'";
         }
         if ($_GET['title'] != "") {
             $where .= " and title like '%" . $_GET['title'] . "%'";
         }
         if ($_GET['name'] != "") {
             $where .= " and name like '%" . $_GET['name'] . "%'";
         }
         if ($_GET['tel'] != "") {
             $where .= " and tel like '%" . $_GET['tel'] . "%'";
         }
         if ($_GET['orderId'] != "") {
             $where .= " and  orderId like '%" . $_GET['orderId'] . "%'";
         }
         if ($_GET['sta'] != "") {
             $where .= " and status = '" . $_GET['sta'] . "'";
         }
         if ($_GET['size'] != "") {
             $size = $_GET['size'];
         }
     }
     $orderOb = new OrderModel();
     $num = $orderOb->getCount($where);
     import("ORG.Util.Page1");
     $pageOb = new Page($page, $size, $num);
     //var_dump($pageOb);
     $start = $pageOb->getStartStr();
     $orderArr = $orderOb->getList1($where, $start, $size);
     //var_dump($orderArr);//echo getLastSql();
     $pageStr = $pageOb->getPageStr1(1);
     $arr = array('page' => $pageStr, 'data' => $orderArr);
     //var_dump($data);
     $data = json_encode($arr);
     echo $data;
     exit;
 }