| 
					
				 | 
			
			
				@@ -12,15 +12,10 @@ use Main\Lib\Core; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 class Card 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	public function locknum() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	public function test() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		$len = Dever::queue('test', 'len'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		$data = Dever::db('youzan/card_list')->state(array('option_status' => 1)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		if ($data) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			foreach ($data as $k => $v) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return $len; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# 分配优惠券,此处需要做高并发处理 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -34,7 +29,9 @@ class Card 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		$info = Dever::db('youzan/card')->one(array('option_key' => $key, 'option_project_id' => $project_id)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if ($info) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			$one = Dever::db('youzan/card_list')->one(array('option_card_id' => $info['id'], 'option_user' => $user)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			if (!$one) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			if ($one) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				return $one; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			} else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				//$id = Dever::queue('card'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				$id = false; 
			 |