Exemple #1
0
 /**
  * 功能描述:获取数据
  * @auther   王晨
  * @datetime 2015年09月29日14:03:46
  * @param $code
  * @param $params
  */
 public static function getData(array $code, array $params)
 {
     $request = [];
     $localResult = [];
     $remoteResult = [];
     foreach ($code as $k => $c) {
         $codeArr = explode('_', $c);
         if (count($codeArr) != 2) {
             return false;
         }
         list($prefix, $event) = $codeArr;
         $request[$prefix][] = $event;
     }
     if (isset($request[self::EVENT_LOCAL_PREFIX])) {
         $localResult = Local::getData($request[self::EVENT_LOCAL_PREFIX], $params);
     }
     if (isset($request[self::EVENT_REMOTE_PREFIX])) {
         $remoteResult = Remote::getData($request[self::EVENT_REMOTE_PREFIX], $params);
         //$remoteResult = Remote::getDataByRedis($request[self::EVENT_REMOTE_PREFIX], $params);
         //$remoteResult = Remote::getDataByProcess($request[self::EVENT_REMOTE_PREFIX], $params);
     }
     return array_merge($localResult, $remoteResult);
 }