wupengfei 1 year ago
parent
commit
3c272d560a
2 changed files with 4 additions and 4 deletions
  1. 1 2
      .idea/workspace.xml
  2. 3 2
      application/common.php

+ 1 - 2
.idea/workspace.xml

@@ -4,7 +4,6 @@
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/common.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/activity_qrcode/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/activity_qrcode/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -377,7 +376,7 @@
       <workItem from="1689641487273" duration="19876000" />
       <workItem from="1689728218007" duration="5405000" />
       <workItem from="1689813742376" duration="13449000" />
-      <workItem from="1689900489647" duration="5661000" />
+      <workItem from="1689900489647" duration="5863000" />
     </task>
     <servers />
   </component>

+ 3 - 2
application/common.php

@@ -412,11 +412,12 @@ function dispose_recommend($list,$needle= 'is_recommend')
 function create_qrcode($id,$user_id,$module = 'activity')
 {
     $qrCode= new \Endroid\QrCode\QrCode();
+    $dir = dirname(realpath(dirname($_SERVER['SCRIPT_FILENAME']))) . '/public/static/'.$module;
+    $filename = $dir.'/'.$id.'_'.$user_id.'.png';
+    @unlink($filename);
     $content  = 'https://'.$_SERVER['HTTP_HOST']."/dist/#/activity-detail?id=1&tg_".$id.'_'.$user_id;
     $qrCode->setText($content);
     $qrCode->setSize(200);
-    $dir = dirname(realpath(dirname($_SERVER['SCRIPT_FILENAME']))) . '/public/static/'.$module;
-    $filename = $dir.'/'.$id.'_'.$user_id.'.png';
     $qrCode->writeFile($filename);
     $url = 'https://'.$_SERVER['SERVER_NAME']."/static/$module/".$id.'_'.$user_id.'.png';
     return $url;