/**
  * 订单管理
  */
 public function index()
 {
     $arr = getDataRange(3);
     $payStatus = I('paystatus', '');
     $orderStatus = I('orderstatus', '');
     $orderid = I('post.orderid', '');
     $userid = I('uid', 0);
     $startdatetime = urldecode($arr[0]);
     //I('startdatetime', , 'urldecode');
     $enddatetime = urldecode($arr[1]);
     //I('enddatetime',   , 'urldecode');
     //分页时带参数get参数
     $params = array('startdatetime' => $startdatetime, 'enddatetime' => $enddatetime, 'wxaccountid' => getWxAccountID());
     $startdatetime = strtotime($startdatetime);
     $enddatetime = strtotime($enddatetime);
     if ($startdatetime === FALSE || $enddatetime === FALSE) {
         LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
         $this->error(L('ERR_DATE_INVALID'));
     }
     $map = array();
     $map['wxaccountid'] = getWxAccountID();
     if (!empty($orderid)) {
         $map['orderid'] = array('like', $orderid . '%');
     }
     if ($payStatus != '') {
         $map['pay_status'] = $payStatus;
         $params['paystatus'] = $payStatus;
     }
     if ($orderStatus != '') {
         $map['order_status'] = $orderStatus;
         $params['orderstatus'] = $orderStatus;
     }
     $map['createtime'] = array(array('EGT', $startdatetime), array('elt', $enddatetime), 'and');
     $page = array('curpage' => I('get.p', 0), 'size' => C('LIST_ROWS'));
     $order = " createtime desc ";
     if ($userid > 0) {
         $map['wxuser_id'] = $userid;
     }
     //
     $result = apiCall(OrdersInfoViewApi::QUERY, array($map, $page, $order, $params));
     //
     if ($result['status']) {
         $this->assign('orderid', $orderid);
         $this->assign('orderStatus', $orderStatus);
         $this->assign('payStatus', $payStatus);
         $this->assign('startdatetime', $startdatetime);
         $this->assign('enddatetime', $enddatetime);
         $this->assign('show', $result['info']['show']);
         $this->assign('list', $result['info']['list']);
         $this->display();
     } else {
         LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
         $this->error($result['info']);
     }
 }
 /**
  * 提现历史查询
  */
 public function query()
 {
     $arr = getDataRange(3);
     //dump($arr);
     $uid = I('uid', 0);
     $where = array();
     $params = array();
     $status = I('status', "");
     if ($uid != 0) {
         $where['uid'] = $uid;
         $params['uid'] = $uid;
     }
     $startdatetime = urldecode($arr[0]);
     $enddatetime = urldecode($arr[1]);
     $params = array('startdatetime' => $startdatetime, 'enddatetime' => $enddatetime, 'wxaccountid' => getWxAccountID());
     $startdatetime = strtotime($startdatetime);
     $enddatetime = strtotime($enddatetime);
     if ($startdatetime === FALSE || $enddatetime === FALSE) {
         LogRecord('INFO:' . $result['info'], '[FILE] ' . __FILE__ . ' [LINE] ' . __LINE__);
         $this->error(L('ERR_DATE_INVALID'));
     }
     $where['create_time'] = array(array('EGT', $startdatetime), array('elt', $enddatetime), 'and');
     //dump(!empty($status));
     if ($status != "" && $status != -1) {
         $where['status'] = $status;
     }
     $page = array('curpage' => I('get.p', 0), 'size' => 10);
     $order = " update_time asc ";
     $result = apiCall(WithdrawApi::QUERY, array($where, $page, $order, $params));
     //dump($where);
     //dump($result);
     ifFailedLogRecord($result, __FILE__ . __LINE__);
     $list = $this->type2dtree($result['info']['list']);
     $list = int_to_string($list, "status", array(0 => "待审", "1" => "通过", 2 => "驳回"));
     $this->assign("status", $status);
     $this->assign("list", $list);
     $this->assign("show", $result['info']['show']);
     $this->assign("startdatetime", $startdatetime);
     $this->assign("enddatetime", $enddatetime);
     $this->display();
 }