Пример #1
0
 public function LogsLists()
 {
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $Logs = new LogsModule();
     $LogsFunction = new LogsFunction();
     $CustomersModule = new CustomersModule();
     $AgentModule = new AgentModule();
     $AgentID = $this->_GET['AgentIDValue'];
     $CustomersID = $this->_GET['CustomersIDValue'];
     $OrderNO = $this->_GET['OrderNO'];
     $Time = $this->_GET['Time'];
     $FromIP = $this->_GET['FromIP'];
     $where = 'where 1';
     $so = '';
     if ($AgentID != NULL) {
         $AgentInfo = $AgentModule->GetLists("where UserName='******'");
         $sql_AgentID = $AgentInfo[0]['AgentID'];
         $where .= " and AgentID='{$sql_AgentID}'";
         $so .= '&AgentIDValue=' . $AgentID;
     }
     if ($CustomersID != NULL) {
         $CustomersInfo = $CustomersModule->GetLists("where CustomersName='{$CustomersID}'");
         $sql_CustomersID = $CustomersInfo[0]['CustomersID'];
         $where .= " and CustomersID='{$sql_CustomersID}'";
         $so .= '&CustomersIDValue=' . $CustomersID;
     }
     if ($OrderNO != NULL) {
         $where .= " and OrderNO='{$OrderNO}'";
         $so .= '&OrderNO=' . $OrderNO;
     }
     if ($Time != NULL) {
         $str_Time = date('Y-m-d', strtotime($Time));
         $time_array = explode('-', $str_Time);
         $where .= " and file='logs/{$time_array['0']}{$time_array['1']}/{$time_array['2']}.log'";
         $so .= '&Time=' . $Time;
     }
     if ($FromIP != NULL) {
         $where .= " and ip='{$FromIP}'";
         $so .= '&FromIP=' . $FromIP;
     }
     $ListsNum = $Logs->GetListsNum($where);
     $Rscount = $ListsNum['Num'];
     $PageSize = 15;
     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'];
         }
         $List = $Logs->GetLists($where, $Offset, $Data['PageSize']);
         foreach ($List as $k => $v) {
             $Data['Data'][$k]['id'] = $v['id'];
             $Data['Data'][$k]['code'] = $LogsFunction->operate[$v['code']];
             $Data['Data'][$k]['status'] = $LogsFunction->operate_status[$v['status']];
             $Data['Data'][$k]['ip'] = $v['ip'];
             $Data['Data'][$k]['time'] = $v['time'];
             $Data['Data'][$k]['Remark'] = $v['Remark'];
             $Data['Data'][$k]['OrderNO'] = $v['OrderNO'];
             $CustomersInfo = $CustomersModule->GetOneInfoByKeyID($v['CustomersID']);
             $Data['Data'][$k]['CustomersName'] = $CustomersInfo['CustomersName'];
             $AgentInfo = $AgentModule->GetOneInfoByKeyID($v['AgentID']);
             $Data['Data'][$k]['AgentUserName'] = $AgentInfo['UserName'];
         }
         MultiPage($Data, 10);
         //dd($Data);
         $this->Data = $Data;
         $this->so = $so;
     } else {
         $Data['Data'][0]['id'] = '无数据结果';
         $this->Data = $Data;
     }
 }
Пример #2
0
 public function Lists()
 {
     include 'Include/LevelArray.php';
     $MysqlWhere = ' where 1';
     $Page = intval($this->_GET['Page']);
     $Page = $Page ? $Page : 1;
     $AgentModule = new AgentModule();
     $AgentApiModule = new AgentApiModule();
     $ListsNum = $AgentModule->GetListsNum($MysqlWhere);
     $Rscount = $ListsNum['Num'];
     $PageSize = 20;
     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'] = $AgentModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']);
         $AgentAccountModule = new AgentAccountModule();
         foreach ($Data['Data'] as $Key => $Value) {
             $Array['AgentID'] = $Value['AgentID'];
             $AgentApiInfo = $AgentApiModule->GetOneInfoByForID($Value['AgentID']);
             if (!empty($AgentApiInfo)) {
                 $Data['Data'][$Key]['Api']['url'] = $AgentApiInfo['url'];
                 $Data['Data'][$Key]['Api']['token'] = $AgentApiInfo['token'];
             }
             $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'];
                 }
             }
         }
         MultiPage($Data, 10);
         //dd($Data);
         $this->Data = $Data;
     }
 }