Bladeren bron

openservice 去掉缓存

shish 6 jaren geleden
bovenliggende
commit
5ec2286833
1 gewijzigde bestanden met toevoegingen van 3 en 36 verwijderingen
  1. 3 36
      common/services/xhWxOpenService.php

+ 3 - 36
common/services/xhWxOpenService.php

@@ -9,42 +9,9 @@ class xhWxOpenService {
 
 	public static function getById($id=0)
 	{
-		$defaultId		= configDict::getConfig('openId');
-		$id				= empty($id) ? $defaultId : $id;
-		$preKey			= configDict::getCacheKey('wxOpen');
-		$cacheKey		= $preKey.$id;
-		$cacheData		= Yii::$app->redis->executeCommand('HGETALL', [$cacheKey]);
-		$data			= [];
-		$list			= [];
-		if(!empty($cacheData)){
-			if(!empty($cacheData)){
-				$x		= 0;
-				foreach($cacheData as $cKey => $cVal){
-					if($cKey%2 == 0){
-						$list[$x]['key'] = $cVal;
-					}else{
-						$list[$x]['value'] = $cVal;
-						$x++;
-					}
-				}
-				foreach($list as $lKey => $lVal){
-					$data[$lVal['key']]	= $lVal['value'];
-				}
-			}
-		}else{
-			$condition		= ['id' => $id];
-			$merchant		= xhWxOpen::getByCondition($condition);
-			if(!empty($merchant)){
-				$arr		= [$cacheKey];
-				foreach($merchant as $key => $val){
-					$arr[]	= $key;
-					$arr[]	= $val;
-				}
-				Yii::$app->redis->executeCommand('HMSET', $arr);
-			}
-			$data			= $merchant;
-		}
-		return $data;
+		$condition		= ['id' => $id];
+		$merchant		= xhWxOpen::getByCondition($condition);
+		return $merchant;
 	}
 	
 	public static function updateById($id, $data)