wupengfei 1 year ago
parent
commit
28d18dd885

+ 9 - 9
.idea/workspace.xml

@@ -2,11 +2,11 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
-      <change afterPath="$PROJECT_DIR$/application/operate/controller/ActivityQrcode.php" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/application/operate/view/activity_qrcode/form.html" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/application/operate/view/activity_qrcode/index.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/activity/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/activity/index.html" 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" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/activity_qrcode/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/activity_qrcode/form.html" 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" />
@@ -378,7 +378,7 @@
       <workItem from="1689581505379" duration="6890000" />
       <workItem from="1689641487273" duration="19876000" />
       <workItem from="1689728218007" duration="5405000" />
-      <workItem from="1689813742376" duration="8002000" />
+      <workItem from="1689813742376" duration="8548000" />
     </task>
     <servers />
   </component>
@@ -508,10 +508,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="1410" y="539" key="#com.intellij.fileTypes.FileTypeChooser/0.0.2560.1400@0.0.2560.1400" timestamp="1684374232836" />
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1689674310618">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1689823539046">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1689674310618" />
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1689823539046" />
     <state x="420" y="147" width="1942" height="1088" key="DiffContextDialog" timestamp="1689585156769">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
@@ -532,10 +532,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2560.1400@0.0.2560.1400" timestamp="1687246001889" />
-    <state x="830" y="186" width="1407" height="1056" key="find.popup" timestamp="1689735326812">
+    <state x="830" y="186" width="1407" height="1056" key="find.popup" timestamp="1689823640182">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="830" y="186" width="1407" height="1056" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1689735326812" />
+    <state x="830" y="186" width="1407" height="1056" key="find.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1689823640182" />
     <state x="1282" y="549" key="ftp.server.browser" timestamp="1684465678841">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 2 - 2
application/common.php

@@ -409,10 +409,10 @@ function dispose_recommend($list,$needle= 'is_recommend')
 }
 
 // 生成二维码
-function create_qrcode($id,$module = 'activity')
+function create_qrcode($id,$user_id,$module = 'activity')
 {
     $qrCode= new \Endroid\QrCode\QrCode();
-    $qrCode->setText($id);
+    $qrCode->setText($id.'_'.$user_id);
     $qrCode->setSize(200);
     $dir = dirname(realpath(dirname($_SERVER['SCRIPT_FILENAME']))) . '/public/'.$module;
     $filename = $dir.'/'.$id.'.png';

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

@@ -1,5 +1,6 @@
 <?php
 namespace app\operate\controller;
+use app\common\model\User;
 use library\Controller;
 use think\Db;
 /**
@@ -80,6 +81,13 @@ class ActivityQrcode extends Controller
     }
 
 
-
+    protected function _form_filter(&$data)
+    {
+        $phone = input('phone');
+        $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');
+    }
 
 }

+ 3 - 36
application/operate/view/activity_qrcode/form.html

@@ -3,39 +3,10 @@
         <div class="layui-card-body">
 
             <div class="layui-form-item">
-                <label class="layui-form-label label-required">标题</label>
+                <label class="layui-form-label label-required">手机号</label>
                 <div class="layui-input-block">
-                    <input name="name" maxlength="60"  value='{$vo.name|default=""}' placeholder="请输入标题" class="layui-input">
-                </div>
-            </div>
-
-            <div class="layui-form-item">
-                <label class="layui-form-label label-required">封面</label>
-                <div class="layui-input-block">
-                    <input name="cover" type="hidden" value="{$vo.cover|default=''}">
-                </div>
-            </div>
-
-
-            <div class="layui-form-item">
-                <label class="layui-form-label label-required">归属模块</label>
-                <div class="layui-input-block">
-                    <input  name="place" {if isset($vo.id)} readonly {/if}  value='{$vo.place|default=""}' placeholder="请输入归属模块" class="layui-input">
-                </div>
-            </div>
-
-            <div class="layui-form-item">
-                <label class="layui-form-label label-required">位置标记</label>
-                <div class="layui-input-block">
-                    <input  name="tag" {if isset($vo.id)} readonly {/if}  value='{$vo.tag|default=""}' placeholder="请输入位置标记" class="layui-input">
-                </div>
-            </div>
-
-
-            <div class="layui-form-item">
-                <label class="layui-form-label label-required">排序</label>
-                <div class="layui-input-block">
-                    <input type="number" name="sort"  value='{$vo.sort|default=""}' placeholder="请输入排序号" class="layui-input">
+                    <input name="phone"   value='{$vo.phone|default=""}' placeholder="请输入推广员手机号" class="layui-input">
+                    <input name="act_id"  type="hidden"  value='{$vo.phone|default=""}' placeholder="请输入推广员手机号" class="layui-input">
                 </div>
             </div>
             {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
@@ -45,8 +16,4 @@
             </div>
         </div>
     </form>
-    <script>
-        window.form.render();
-        $('[name="cover"]').uploadOneImage();
-    </script>
 </div>

+ 3 - 3
application/operate/view/activity_qrcode/index.html

@@ -1,9 +1,9 @@
 {extend name='admin@main'}
-<!--
+
 {block name="button"}
-<button data-modal='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
+<button data-modal='{:url("add")}?act_id={$Think.get.act_id}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
 {/block}
--->
+
 
 {block name="content"}
 <div class="think-box-shadow">