moonsflyer 6 luni în urmă
părinte
comite
d63de5ac53
2 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 7 0
      app/common.php
  2. 1 1
      app/common/service/GiftCardQrCodeService.php

+ 7 - 0
app/common.php

@@ -35,6 +35,13 @@ function gift_card_pass(){
     return str_shuffle($time);
     return str_shuffle($time);
 }
 }
 
 
+/*
+ * 导出数据到日志文件
+ * */
+function outFileLog($data,$filename='log',$title='data'){
+    file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/log/'.$filename.'.txt', PHP_EOL .date('Y-m-d h:i:s', time()).'~'.$title.':' . json_encode($data,JSON_UNESCAPED_UNICODE), FILE_APPEND);
+}
+
 function getNonceStr($length = 32) {
 function getNonceStr($length = 32) {
     $chars = "ACEFGHMNQRTYabdefgijmnpqr";
     $chars = "ACEFGHMNQRTYabdefgijmnpqr";
     $str ="";
     $str ="";

+ 1 - 1
app/common/service/GiftCardQrCodeService.php

@@ -43,7 +43,7 @@ class GiftCardQrCodeService
             // $response = $app->app_code->get($page . '?' . $scene, [
             // $response = $app->app_code->get($page . '?' . $scene, [
             //     'width' => 280,
             //     'width' => 280,
             // ]);
             // ]);
-
+            outFileLog('1','giftCard','test');
             // 方案2:使用getQrCode方法
             // 方案2:使用getQrCode方法
              $response = $app->app_code->getQrCode($page . '?' . $scene, 280
              $response = $app->app_code->getQrCode($page . '?' . $scene, 280
              );
              );