예제 #1
0
 public function Recharge()
 {
     $this->MyAction = 'Recharge';
     $Page = intval($this->_GET['Page']);
     $type = $this->_GET['type'];
     $Page = $Page ? $Page : 1;
     $OrderModule = new OrderModule();
     $OrderDescriptionModule = new OrderDescriptionModule();
     $MysqlWhere = "where AgentID={$_SESSION['AgentID']} and Type=1";
     $Searchtxt = $this->_POST['searchtxt'];
     $FengxinID = FENGXIN_ID;
     $GBaoPenID = GBAOPEN_ID;
     if ($Searchtxt != '') {
         $MysqlWhere .= " and OrderNO='{$Searchtxt}'";
     }
     if ($type == 'f') {
         $MysqlWhere .= " and ProjectID='{$FengxinID}'";
     } elseif ($type == 'g') {
         $MysqlWhere .= " and ProjectID='{$GBaoPenID}'";
     } else {
     }
     $OrderInfo = $OrderModule->GetLists($MysqlWhere);
     $ListsNum = $OrderModule->GetListsNum($MysqlWhere);
     $Rscount = $ListsNum['Num'];
     $PageSize = 10;
     if ($Rscount) {
         $Data['RecordCount'] = $Rscount;
         $Data['PageSize'] = $PageSize ? $PageSize : $Data['RecordCount'];
         $Data['PageCount'] = ceil($Data['RecordCount'] / $PageSize);
         $Data['Page'] = min($Page, $Data['PageCount']);
         $Offset = ($Page - 1) * $Data['PageSize'];
         if ($Page > $Data['PageCount']) {
             $Page = $Data['PageCount'];
         }
         $Data['Data'] = $OrderModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         //dd($Data);
         foreach ($Data['Data'] as $k => $v) {
             $Description = $OrderDescriptionModule->GetOneInfoByKeyID($v[DescriptionID]);
             $Data['Data'][$k]['Description'] = $Description['Description'];
             if ($v['ProjectID'] == $FengxinID) {
                 $Data['Data'][$k]['ProjectID'] = '风信';
             }
             if ($v['ProjectID'] == $GBaoPenID) {
                 $Data['Data'][$k]['ProjectID'] = 'G宝盆';
             }
         }
         MultiPage($Data, 10);
         $this->Data = $Data;
     }
 }
예제 #2
0
 public function Seach()
 {
     $MysqlWhere = ' where 1';
     $WhereGet = '';
     $this->seachValue = trim($this->_GET['seachValue']);
     //订单号
     $OrderNO = trim($this->_GET['OrderNO']);
     if ($OrderNO != 0) {
         $MysqlWhere .= ' and OrderNO=\'' . $OrderNO . '\'';
         $WhereGet .= '&OrderNO=' . $OrderNO;
         $this->OrderNO = $OrderNO;
     }
     //入账/消费
     $Type = $this->_GET['Type'];
     if ($Type == '入账') {
         $MysqlWhere .= ' and Type=1';
         $WhereGet .= '&Type=' . $Type;
         $this->Type = $Type;
     }
     if ($Type == '消费') {
         $MysqlWhere .= ' and Type=0';
         $WhereGet .= '&Type=' . $Type;
         $this->Type = $Type;
     }
     //代理商
     $AgentIDValue = trim($this->_GET['AgentIDValue']);
     if ($AgentIDValue != '') {
         $AgentModule = new AgentModule();
         $AgentInfo = $AgentModule->GetOneInfoByArrayKeys(array('UserName' => $AgentIDValue));
         $MysqlWhere .= ' and AgentID=' . $AgentInfo['AgentID'];
         $WhereGet .= '&AgentIDValue=' . $AgentIDValue;
         $this->AgentIDValue = $AgentIDValue;
     }
     //产品
     $ProjectIDValue = trim($this->_GET['ProjectIDValue']);
     if ($ProjectIDValue != '') {
         $MysqlWhere .= ' and ProjectID=' . $ProjectIDValue;
         $WhereGet .= '&ProjectIDValue=' . $ProjectIDValue;
         $this->ProjectIDValue = $ProjectIDValue;
     }
     //客户企业名称
     $CustomersIDValue = trim($this->_GET['CustomersIDValue']);
     if ($CustomersIDValue != '') {
         $CustomersModule = new CustomersModule();
         $CustomersInfo = $CustomersModule->GetOneInfoByArrayKeys(array('CompanyName' => $CustomersIDValue));
         $MysqlWhere .= ' and CustomersID=' . $CustomersInfo['CustomersID'];
         $WhereGet .= '&CustomersIDValue=' . $CustomersIDValue;
         $this->CustomersIDValue = $CustomersIDValue;
     }
     //下订单开始时间
     $StartTime = trim($this->_GET['StartTime']);
     $this->StartTime = $StartTime;
     if ($StartTime != '') {
         $StartTime = $StartTime . ' 00:00:00';
         $MysqlWhere .= ' and AddTime>\'' . $StartTime . '\'';
         $WhereGet .= '&StartTime=' . $StartTime;
     }
     //下订单结束时间
     $EndTime = trim($this->_GET['EndTime']);
     $this->EndTime = $EndTime;
     if ($EndTime != '') {
         $EndTime = $EndTime . ' 23:59:59';
         $MysqlWhere .= ' and AddTime<\'' . $EndTime . '\'';
         $WhereGet .= '&EndTime=' . $EndTime;
     }
     //最低交易金额
     $MinAmount = trim($this->_GET['MinAmount']);
     if ($MinAmount != '') {
         $MysqlWhere .= ' and Amount>' . $MinAmount;
         $WhereGet .= '&MinAmount=' . $MinAmount;
         $this->MinAmount = $MinAmount;
     }
     //最高交易金额
     $MaxAmount = trim($this->_GET['MaxAmount']);
     if ($MaxAmount != '') {
         $MysqlWhere .= ' and Amount<' . $MaxAmount;
         $WhereGet .= '&MaxAmount=' . $MaxAmount;
         $this->MaxAmount = $MaxAmount;
     }
     //客户端IP
     $FromIP = trim($this->_GET['FromIP']);
     if ($FromIP != '') {
         $MysqlWhere .= ' and FromIP=\'' . $FromIP . '\'';
         $WhereGet .= '&FromIP=' . $FromIP;
         $this->FromIP = $FromIP;
     }
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $OrderModule = new OrderModule();
     $ListsNum = $OrderModule->GetListsNum($MysqlWhere);
     $Rscount = $ListsNum['Num'];
     $PageSize = 5000;
     if ($WhereGet == '') {
         $PageSize = 10;
     }
     if ($Rscount) {
         $Data['RecordCount'] = $Rscount;
         $Data['PageSize'] = $PageSize ? $PageSize : $Data['RecordCount'];
         $Data['PageCount'] = ceil($Data['RecordCount'] / $PageSize);
         $Data['Page'] = min($Page, $Data['PageCount']);
         $Offset = ($Page - 1) * $Data['PageSize'];
         if ($Page > $Data['PageCount']) {
             $Page = $Data['PageCount'];
         }
         $Data['Data'] = $OrderModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         $AgentModule = new AgentModule();
         $AgentAccountModule = new AgentAccountModule();
         $ProjectModule = new ProjectModule();
         $OrderDescriptionModule = new OrderDescriptionModule();
         $RuZhangNum = 0;
         $RuZhang = 0;
         $XiaoFei = 0;
         $XiaoFeiNum = 0;
         foreach ($Data['Data'] as $Key => $Value) {
             $Array['AgentID'] = $Value['AgentID'];
             $AgentInfo = $AgentModule->GetOneInfoByKeyID($Array['AgentID']);
             $Data['Data'][$Key]['UserName'] = $AgentInfo['UserName'];
             $ProjectInfo = $ProjectModule->GetOneInfoByKeyID($Value['ProjectID']);
             $Data['Data'][$Key]['ProjectName'] = $ProjectInfo['ProjectName'];
             $AgentAccountInfo = $AgentAccountModule->GetLists('where AgentID=' . $Array['AgentID']);
             $Num = count($AgentAccountInfo);
             if ($Num == 0) {
                 $Data['Data'][$Key]['Total'] = '0';
                 $Data['Data'][$Key]['Balance'] = '0';
             } else {
                 foreach ($AgentAccountInfo as $V) {
                     $Data['Data'][$Key]['Total'] += $V['Total'];
                     $Data['Data'][$Key]['Balance'] += $V['Balance'];
                 }
             }
             $OrderDescriptionInfo = $OrderDescriptionModule->GetOneInfoByKeyID($Value['DescriptionID']);
             $Data['Data'][$Key]['Description'] = $OrderDescriptionInfo['Description'];
             if ($Value['Type'] == 1) {
                 $Data['Data'][$Key]['TypeName'] = '入账';
                 $RuZhang += $Value['Amount'];
                 $RuZhangNum++;
             } else {
                 $Data['Data'][$Key]['TypeName'] = '消费';
                 $XiaoFei += $Value['Amount'];
                 $XiaoFeiNum++;
             }
         }
         $this->RuZhangNum = $RuZhangNum;
         $this->RuZhang = $RuZhang;
         $this->XiaoFei = $XiaoFei;
         $this->XiaoFeiNum = $XiaoFeiNum;
         MultiPage($Data, 10);
         $this->Data = $Data;
         $this->WhereGet = $WhereGet;
     }
 }