Exemplo n.º 1
0
 /**
  * 获得日志列表
  */
 public static function getList($paramArr)
 {
     $options = array('appName' => '', 'subId' => 0, 'objId' => 0, 'num' => 10, 'offset' => '', 'getNum' => 0, 'whereSql' => "");
     if (is_array($paramArr)) {
         $options = array_merge($options, $paramArr);
     }
     extract($options);
     $idMap = ZOL_Config::get("Star/InnerApp", "ID");
     #顶级的分类
     if (!isset($idMap[$appName])) {
         return false;
     }
     $subIdMap = ZOL_Config::get("Star/InnerApp", "SUBID");
     #二级的分类
     #将subid从英文形式转换为数字
     if (isset($subIdMap[$appName]) && isset($subIdMap[$appName][$subId])) {
         $subId = $subIdMap[$appName][$subId]["id"];
     }
     if ($appName) {
         $whereSql .= " and appId = " . $idMap[$appName]["id"];
     }
     if ($subId) {
         $whereSql .= " and subId = " . $subId;
     }
     if ($objId) {
         $whereSql .= " and objId = '" . $objId . "'";
     }
     $res = Helper_Dao::getRows(array('dbName' => "Db_Star", 'tblName' => "log_operations", 'offset' => $offset, 'limit' => $num, 'whereSql' => $whereSql . " order by id desc ", 'debug' => 0));
     if ($getNum) {
         #是否获得数量
         $cnt = Helper_Dao::getCount(array('dbName' => "Db_Star", 'tblName' => "log_operations", 'whereSql' => $whereSql, 'debug' => 0));
         return array('allNum' => $cnt, 'data' => $res);
     }
     return $res;
 }