コード例 #1
0
ファイル: Stat.php プロジェクト: soone/xgm
 public function scard()
 {
     if ($this->req['get']['ctype'] || $this->req['get']['buyname'] || $this->req['get']['exp'] || $this->req['get']['cvalue'] || $this->req['get']['cstatus'] != '') {
         $page = $this->req['get']['page'] ? $this->req['get']['page'] : 1;
         $perNum = 30;
         $start = ($page - 1) * $perNum;
         $cWhere = array('table' => 'xgm_cardlib', 'key' => array('count(*)'));
         $dWhere = array('table' => 'xgm_cardlib', 'key' => array('ci_id', 'co_id', 'cl_num', 'cl_state', 'cl_otime', 'cl_expire', 'ci_money', 'co_order'), 'limit' => array($start, $perNum));
         $theOrInfo = array();
         if ($this->req['get']['buyname']) {
             $cOrder = $this->db->get(array('table' => 'xgm_cardorder', 'key' => array('co_id', 'co_order', 'cu_name', 'cview_name'), 'where' => array('and' => array('cu_name' => $this->req['get']['buyname']))));
             for ($i = 0, $j = count($cOrder); $i < $j; $i++) {
                 $cOrderId[] = $cOrder[$i][0];
                 $theOrInfo[$cOrder[$i][0]] = $cOrder[$i];
             }
             $and['co_id'] = $cOrderId;
         }
         $this->req['get']['exp'] ? $and['cl_expire'] = array($this->req['get']['exp'] . ' 00:00:00', $this->req['get']['exp'] . ' 23:59:59') : '';
         $this->req['get']['cvalue'] ? $and['ci_money'] = $this->req['get']['cvalue'] : '';
         $this->req['get']['cstatus'] || $this->req['get']['cstatus'] === 0 ? $and['cl_state'] = $this->req['get']['cstatus'] : '';
         if ($and) {
             $cWhere['where']['and'] = $and;
             $dWhere['where']['and'] = $and;
             $cWhere['where']['oper']['cl_expire'] = array('>=', '<=');
             $dWhere['where']['oper']['cl_expire'] = array('>=', '<=');
         }
         $allNums = $this->db->get($cWhere);
         $data = $this->db->get($dWhere);
         $cardInfoArr = array();
         for ($i = 0, $l = sizeof($data); $i < $l; $i++) {
             if (!array_key_exists($data[$i][1], $theOrInfo)) {
                 $cOrderInfo = $this->db->get(array('table' => 'xgm_cardorder', 'key' => array('co_id', 'co_order', 'cu_name', 'cview_name'), 'where' => array('and' => array('co_id' => $data[$i][1])), 'limit' => array(0, 1)));
                 $theOrInfo[$data[$i][1]] = $cOrderInfo[0];
             }
             if (!array_key_exists($data[$i][0], $cardInfoArr)) {
                 $cInfoName = $this->db->get(array('table' => 'xgm_cardinfo', 'key' => array('ci_name'), 'where' => array('and' => array('ci_id' => $data[$i][0])), 'limit' => array(0, 1)));
                 $cardInfoArr[$data[$i][0]] = $cInfoName[0][0];
             }
             $myData[] = array($theOrInfo[$data[$i][1]][1], $data[$i][2], $cardInfoArr[$data[$i][0]], $theOrInfo[$data[$i][1]][3], $theOrInfo[$data[$i][1]][2], $data[$i][4], $data[$i][5], $data[$i][3]);
         }
         $page = N8_Helper_Helper::setPage(array('allNums' => $allNums[0][0], 'curPage' => $page, 'perNum' => $perNum));
     }
     $this->render(array('tplDir' => $this->conf->get('view->rDir'), 'cardlist' => $myData, 'page' => $page));
 }
コード例 #2
0
ファイル: User.php プロジェクト: soone/xgm
 public function orderuser()
 {
     $page = $this->req['get']['page'] ? $this->req['get']['page'] : 1;
     $perNum = 30;
     $start = ($page - 1) * $perNum;
     $allNums = $this->db->get(array('table' => 'xgm_orderuser', 'key' => array('count(*)')));
     $data = $this->db->get(array('table' => 'xgm_orderuser', 'key' => array('*'), 'limit' => array($start, $perNum)));
     $page = N8_Helper_Helper::setPage(array('allNums' => $allNums[0][0], 'curPage' => $page, 'perNum' => $perNum));
     $this->render(array('tplDir' => $this->conf->get('view->rDir'), 'data' => $data, 'page' => $page));
 }
コード例 #3
0
ファイル: Card.php プロジェクト: soone/xgm
 public function colist()
 {
     $page = $this->req['get']['page'] ? $this->req['get']['page'] : 1;
     $perNum = 30;
     $start = ($page - 1) * $perNum;
     $allNums = $this->db->get(array('table' => 'xgm_cardorder', 'key' => array('count(*)')));
     $data = $this->db->get(array('table' => 'xgm_cardorder', 'key' => array('co_id', 'co_order', 'co_total', 'co_totalnums', 'co_ava', 'cview_name', 'co_invoice', 'co_ctime', 'cu_name', 'cu_id', 'co_status'), 'limit' => array($start, $perNum), 'order' => array('desc' => array('co_id'))));
     $page = N8_Helper_Helper::setPage(array('allNums' => $allNums[0][0], 'curPage' => $page, 'perNum' => $perNum));
     $this->render(array('tplDir' => $this->conf->get('view->rDir'), 'data' => $data, 'page' => $page));
 }