xiongzhu 7 лет назад
Родитель
Сommit
c392865f93

+ 3 - 4
src/main/webapp/member/query_model.jsp

@@ -36,8 +36,8 @@
         int Area = Integer.parseInt(request.getParameter("Area"));
         String keyword = ExtendString.getDBStr(request.getParameter("keyword"));
 
-        String BaseSQL = "select a.pk as ModelInfopk, a.MemberPK, b.Tel, a.Name, a.Stage, a.LName, b.Phone, a.addr, " +
-                "		 b.Area, a.BrokePK, a.BMemberPK, b.qrcode, " +
+        String BaseSQL = "select a.pk as ModelInfopk, a.MemberPK, b.Tel, a.Name, a.LName, b.Phone, " +
+                "		 b.Area, a.BrokePK, a.BMemberPK, b.qrcode, b.pet, " +
                 "       b.income_ratio_gift as ratio_R, " +
                 "       b.income_ratio_video as ratio_V, " +
                 "       b.income_ratio_service as ratio_S, " +
@@ -133,9 +133,8 @@
     </el-input>
     <el-table :data="tableData" v-loading="loading">
         <el-table-column prop="tel" label="帐号" width="120"></el-table-column>
-        <el-table-column prop="name" label="姓名"></el-table-column>
+        <el-table-column prop="pet" label="姓名"></el-table-column>
         <el-table-column prop="phone" label="电话" width="120"></el-table-column>
-        <el-table-column prop="stage" label="艺名"></el-table-column>
         <el-table-column prop="lname" label="个性签名" width="120"></el-table-column>
         <el-table-column prop="ratio_r" label="红包分成(%)" width="120"></el-table-column>
         <el-table-column prop="ratio_v" label="视频分成(%)" width="120"></el-table-column>

+ 59 - 26
src/main/webapp/system/inviteRank.jsp

@@ -20,11 +20,8 @@
 <%@ page import="constants.Constants" %>
 <%@ page import="dbconnection.DbConnection" %>
 <%@ page import="org.apache.commons.lang.StringUtils" %>
-<%@ page import="static jooq.Tables.CASHRECORD" %>
-<%@ page import="constants.PayConstants" %>
-<%@ page import="static jooq.Tables.RECOMMEND_APPLY" %>
-<%@ page import="static jooq.Tables.*" %>
 <%@ page import="org.jooq.*" %>
+<%@ page import="jooq.tables.Memberinfo" %>
 <jsp:useBean id="db" class="dbconnection.DbConnection"/>
 <%
 
@@ -33,31 +30,54 @@
     out.clear();
     if (operator.equals("query")) {
         String paramPage = request.getParameter("page");
-        int    pageIndex = 1;
+        Integer type = Integer.valueOf(request.getParameter("type"));
+        int pageIndex = 1;
         if (StringUtils.isNotEmpty(paramPage)) {
             pageIndex = Integer.valueOf(paramPage);
         }
+        String introducerType, introduceType;
+        switch (type) {
+            case 1:
+                introducerType = thmodel.MEMTYPE_Model;
+                introduceType = thmodel.MEMTYPE_HuiYuan;
+                break;
+            case 2:
+                introducerType = thmodel.MEMTYPE_Model;
+                introduceType = thmodel.MEMTYPE_Model;
+                break;
+            case 3:
+                introducerType = thmodel.MEMTYPE_HuiYuan;
+                introduceType = thmodel.MEMTYPE_HuiYuan;
+                break;
+            default:
+                introducerType = thmodel.MEMTYPE_Model;
+                introduceType = thmodel.MEMTYPE_HuiYuan;
+                break;
+        }
+        Memberinfo a = MEMBERINFO.as("a");
+        Memberinfo b = MEMBERINFO.as("b");
+        Field<Integer> count = ctx.selectCount().from(b).where(b.INTRODUCERPK.equal(a.PK)).and(b.MEMBTYPE.equal(Integer.valueOf(introduceType))).asField("count");
+        List<Field> fields = new ArrayList<>(Arrays.asList(a.fields()));
+        fields.add(count);
+        Result<Record> records = ctx.select(fields.stream().toArray(Field[]::new))
+                .from(a)
+                .where(a.MEMBTYPE.equal(Integer.valueOf(introducerType)))
+                .orderBy(count.desc())
+                .limit((pageIndex - 1) * 10, 10)
+                .fetch();
+
+        Record totalResult = ctx.select(ctx.selectCount().from(MEMBERINFO).where(MEMBERINFO.MEMBTYPE.equal(Integer.valueOf(introducerType))).asField("total"))
+                .fetchOne();
 
-        String sql = "select count(a.IntroducerPK) as num, a.IntroducerPK, b.* " +
-                "from memberinfo a " +
-                "join memberinfo b on b.PK = a.IntroducerPK " +
-                "where a.IntroducerPK is not null " +
-                "group by a.IntroducerPK order by num desc"
-                + " limit " + (pageIndex - 1) * 10 + " ,10";
-        String countSql = "select count(*) as total " +
-                "from (select count(*)\n" +
-                "      from memberinfo a\n" +
-                "             join memberinfo b on b.PK = a.IntroducerPK\n" +
-                "      where a.IntroducerPK is not null\n" +
-                "      group by a.IntroducerPK) a";
-        List<JSONObject> jsonList = DBRecordsPack.Pack(db, sql);
-        int              total    = DBRecordsPack.Pack(db, countSql).get(0).getInt("total");
-        JSONObject       res      = new JSONObject();
+        List<JSONObject> jsonList = DBRecordsPack.Pack(records);
+        JSONObject res = new JSONObject();
         res.put("data", jsonList);
-        res.put("total", total);
+        res.put("total", DBRecordsPack.Pack(totalResult).getInt("total"));
+        ctx.close();
         response.setContentType("application/json");
         out.print(res.toString());
         return;
+
     }
 %>
 <!DOCTYPE html>
@@ -69,10 +89,16 @@
 </head>
 <body>
 <div id="app">
+    <el-radio-group v-model="type">
+        <el-radio :label="1">模特邀请用户</el-radio>
+        <el-radio :label="2">模特邀请模特</el-radio>
+        <el-radio :label="3">用户邀请用户</el-radio>
+    </el-radio-group>
+
     <el-table :data="tableData">
-        <el-table-column prop="pet" label="姓名"></el-table-column>
-        <el-table-column prop="tel" label="账号"></el-table-column>
-        <el-table-column prop="num" label="邀请数量"></el-table-column>
+        <el-table-column prop="Pet" label="姓名"></el-table-column>
+        <el-table-column prop="Tel" label="账号"></el-table-column>
+        <el-table-column prop="count" label="邀请数量"></el-table-column>
     </el-table>
     <el-pagination
             background
@@ -95,7 +121,8 @@
             loading: false,
             tableData: [],
             page: 1,
-            total: 0
+            total: 0,
+            type: 1
         },
         methods: {
             getData: function () {
@@ -104,7 +131,8 @@
                     url: "${pageContext.request.contextPath}${pageContext.request.servletPath}",
                     data: {
                         operator: 'query',
-                        page: this.page
+                        page: this.page,
+                        type: this.type
                     },
                     success: function (res) {
                         this.loading = false;
@@ -122,6 +150,11 @@
                 this.page = page;
                 this.getData();
             }
+        },
+        watch: {
+            type: function () {
+                this.getData();
+            }
         }
     });
 </script>

+ 56 - 4
src/main/webapp/system/version.jsp

@@ -4,7 +4,12 @@
 <%@ page import="java.io.*" %>
 <%@ page import="org.jooq.DSLContext" %>
 <%@ page import="org.jooq.impl.DSL" %>
-<%@ page import="static jooq.Tables.SETTINGS" %> <%--
+<%@ page import="static jooq.Tables.SETTINGS" %>
+<%@ page import="util.UpLoad" %>
+<%@ page import="org.apache.commons.fileupload.DiskFileUpload" %>
+<%@ page import="java.util.List" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="org.apache.commons.fileupload.FileItem" %> <%--
   Created by IntelliJ IDEA.
   User: drew
   Date: 2018/11/27
@@ -27,6 +32,34 @@
         out.print(result.toString());
         ctx.close();
         return;
+    } else if ("upload".equals(operator)) {
+        response.setContentType("application/json");
+        JSONObject result = new JSONObject();
+        try {
+            DiskFileUpload fu = new DiskFileUpload();
+            //fu.initialize(pageContext);
+            fu.setHeaderEncoding("UTF-8"); // 此句为主要代码
+            // 设置允许用户上传文档大小,单位:字节,这里设为100M
+            fu.setSizeMax(100 * 1024 * 1024);
+            // 设置最多只允许在内存中存储的数据,单位:字节
+            fu.setSizeThreshold(4096);
+            // 开始读取上传信息
+            List fileItems = fu.parseRequest(request);
+            // 依次处理每个上传的文件
+            for (Object fileItem : fileItems) {
+                FileItem item = (FileItem) fileItem;
+                String fieldName = item.getFieldName();
+                UpLoad.PostFileResult R = UpLoad.PostFile(request, item, "apk");
+                result.put("data", "http://app.chmo.net/" + R.PostFileURL);
+                result.put("success", true);
+                out.print(result.toString());
+                return;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        result.put("success", false);
+        out.print(result.toString());
     }
     String appJson = ctx.select().from(SETTINGS).where(SETTINGS.NAME.equal("appVersion")).fetchOne(SETTINGS.VALUE);
     ctx.close();
@@ -50,7 +83,7 @@
             <el-input v-model="appVersion.ios.model.version"></el-input>
         </el-form-item>
         <el-form-item label="下载地址">
-            <el-input v-model="appVersion.ios.model.url"></el-input>
+            <el-input v-model="appVersion.ios.model.url" disabled></el-input>
         </el-form-item>
         <el-form-item label="强制更新">
             <el-radio-group v-model="appVersion.ios.model.force">
@@ -65,7 +98,7 @@
             <el-input v-model="appVersion.ios.member.version"></el-input>
         </el-form-item>
         <el-form-item label="下载地址">
-            <el-input v-model="appVersion.ios.member.url"></el-input>
+            <el-input v-model="appVersion.ios.member.url" disabled></el-input>
         </el-form-item>
         <el-form-item label="强制更新">
             <el-radio-group v-model="appVersion.ios.member.force">
@@ -80,7 +113,18 @@
             <el-input v-model="appVersion.android.version"></el-input>
         </el-form-item>
         <el-form-item label="下载地址">
-            <el-input v-model="appVersion.android.url"></el-input>
+            <el-input v-model="appVersion.android.url" disabled>
+                <template slot="prepend">
+                    <el-upload
+                            class="upload-demo"
+                            action="${pageContext.request.contextPath}${pageContext.request.servletPath}?operator=upload"
+                            :show-file-list="false"
+                            :before-upload="beforeUpload"
+                            :on-success="uploadSuccess">
+                        <el-button type="primary">点击上传APK</el-button>
+                    </el-upload>
+                </template>
+            </el-input>
         </el-form-item>
         <el-form-item label="强制更新">
             <el-radio-group v-model="appVersion.android.force">
@@ -111,6 +155,14 @@
                         }
                     }.bind(this)
                 });
+            },
+            beforeUpload: function (file) {
+                return file.type === 'application/vnd.android.package-archive';
+            },
+            uploadSuccess: function (res, file) {
+                if (res.success) {
+                    this.appVersion.android.url = res.data
+                }
             }
         }
     })

BIN
src/main/webapp/upload/activity/2018-06-15/451123138753678023.jpg


BIN
src/main/webapp/upload/activity/2018-06-15/632648482744828567.jpg


BIN
src/main/webapp/upload/logo/2018-06-14/151433619925078671.png


BIN
src/main/webapp/upload/logo/2018-06-14/514545182007297920.png


BIN
src/main/webapp/upload/logo/2018-06-14/563623058827878337.png


BIN
src/main/webapp/upload/photo/2018-06-11/165506282189714005.png


BIN
src/main/webapp/upload/photo/2018-06-11/354727579990910245.png


BIN
src/main/webapp/upload/photo/2018-06-11/460971478136359524.png


BIN
src/main/webapp/upload/photo/2018-06-11/493452113473660865.jpg


BIN
src/main/webapp/upload/photo/2018-06-11/861537846612330270.png


BIN
src/main/webapp/upload/photo/2018-06-11/864906035870622763.png


BIN
src/main/webapp/upload/photo/2018-06-11/900857256939806662.png