wupengfei 1 year ago
parent
commit
b6d29be5b3

+ 2 - 1
.idea/workspace.xml

@@ -3,6 +3,7 @@
   <component name="ChangeListManager">
     <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/controller/ActivityQrcode.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/ActivityQrcode.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -375,7 +376,7 @@
       <workItem from="1689581505379" duration="6890000" />
       <workItem from="1689641487273" duration="19876000" />
       <workItem from="1689728218007" duration="5405000" />
-      <workItem from="1689813742376" duration="8583000" />
+      <workItem from="1689813742376" duration="8833000" />
     </task>
     <servers />
   </component>

+ 3 - 3
application/common.php

@@ -414,10 +414,10 @@ function create_qrcode($id,$user_id,$module = 'activity')
     $qrCode= new \Endroid\QrCode\QrCode();
     $qrCode->setText($id.'_'.$user_id);
     $qrCode->setSize(200);
-    $dir = dirname(realpath(dirname($_SERVER['SCRIPT_FILENAME']))) . '/public/'.$module;
-    $filename = $dir.'/'.$id.'.png';
+    $dir = dirname(realpath(dirname($_SERVER['SCRIPT_FILENAME']))) . '/public/static/'.$module;
+    $filename = $dir.'/'.$id.'_'.$user_id.'.png';
     $qrCode->writeFile($filename);
-    $url = 'https://'.$_SERVER['SERVER_NAME']."/$module/".$id.'.png';
+    $url = 'https://'.$_SERVER['SERVER_NAME']."/static/$module/".$id.'_'.$user_id.'.png';
     return $url;
 }
 

+ 1 - 1
application/operate/controller/ActivityQrcode.php

@@ -89,7 +89,7 @@ class ActivityQrcode extends Controller
             $user_id = User::where('phone|email',$phone)->value('id');
             if(!$user_id)$this->error('用户不存在');
             $data['user_id'] = $user_id;
-            $data['qrcode'] = create_qrcode($data['act_id'],$user_id,$module = 'activity');
+            $data['qrcode'] = create_qrcode($data['act_id'],$user_id,'activity');
         }
 
     }