|  | @@ -95,4 +95,25 @@ class UserCoupons extends Api
 | 
	
		
			
				|  |  |              $this->error($e->getMessage());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public function newtest()
 | 
	
		
			
				|  |  | +    {
 | 
	
		
			
				|  |  | +            $id = 5;
 | 
	
		
			
				|  |  | +            $text = 'hexiaocoupon_'.$id;
 | 
	
		
			
				|  |  | +            $logo = '';
 | 
	
		
			
				|  |  | +            $filRoute = '/uploads/temp/';
 | 
	
		
			
				|  |  | +            $saveDir = ROOT_PATH.'public\uploads\temp'.DS;
 | 
	
		
			
				|  |  | +            $fileStr = md5('coupon_'.$id);
 | 
	
		
			
				|  |  | +            $localpng = $saveDir.$fileStr.'.png';
 | 
	
		
			
				|  |  | +            //验证存在直接返回
 | 
	
		
			
				|  |  | +            $userCouponsUrl = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$filRoute.$fileStr.'.png';
 | 
	
		
			
				|  |  | +            if (!file_exists($localpng)) {
 | 
	
		
			
				|  |  | +                build_qrcode($text, $logo, $saveDir,$fileStr);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            $result = [
 | 
	
		
			
				|  |  | +                'url' => $userCouponsUrl,
 | 
	
		
			
				|  |  | +            ];
 | 
	
		
			
				|  |  | +            $this->success('获取成功',$result);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |