浏览代码

谁是舞王

xiongzhu 7 年之前
父节点
当前提交
b25da8f009

+ 6 - 1
src/main/java/jooq/tables/Ads.java

@@ -41,7 +41,7 @@ import org.jooq.impl.TableImpl;
 @SuppressWarnings({ "all", "unchecked", "rawtypes" })
 public class Ads extends TableImpl<AdsRecord> {
 
-    private static final long serialVersionUID = 263863894;
+    private static final long serialVersionUID = 1772433087;
 
     /**
      * The reference instance of <code>thmodel.ads</code>
@@ -76,6 +76,11 @@ public class Ads extends TableImpl<AdsRecord> {
      */
     public final TableField<AdsRecord, String> NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR(255), this, "");
 
+    /**
+     * The column <code>thmodel.ads.detail</code>.
+     */
+    public final TableField<AdsRecord, String> DETAIL = createField("detail", org.jooq.impl.SQLDataType.CLOB, this, "");
+
     /**
      * Create a <code>thmodel.ads</code> table reference
      */

+ 3 - 3
src/main/java/jooq/tables/Memberinfo.java

@@ -43,7 +43,7 @@ import org.jooq.impl.TableImpl;
 @SuppressWarnings({ "all", "unchecked", "rawtypes" })
 public class Memberinfo extends TableImpl<MemberinfoRecord> {
 
-    private static final long serialVersionUID = -2015425418;
+    private static final long serialVersionUID = -847357740;
 
     /**
      * The reference instance of <code>thmodel.memberinfo</code>
@@ -309,9 +309,9 @@ public class Memberinfo extends TableImpl<MemberinfoRecord> {
     public final TableField<MemberinfoRecord, BigDecimal> SHARE_RATIO_SERVICE = createField("share_ratio_service", org.jooq.impl.SQLDataType.DECIMAL(18, 4).defaultValue(org.jooq.impl.DSL.inline("10.0000", org.jooq.impl.SQLDataType.DECIMAL)), this, "");
 
     /**
-     * The column <code>thmodel.memberinfo.broker_ratio_git</code>.
+     * The column <code>thmodel.memberinfo.broker_ratio_gift</code>.
      */
-    public final TableField<MemberinfoRecord, BigDecimal> BROKER_RATIO_GIT = createField("broker_ratio_git", org.jooq.impl.SQLDataType.DECIMAL(18, 4).defaultValue(org.jooq.impl.DSL.inline("10.0000", org.jooq.impl.SQLDataType.DECIMAL)), this, "");
+    public final TableField<MemberinfoRecord, BigDecimal> BROKER_RATIO_GIFT = createField("broker_ratio_gift", org.jooq.impl.SQLDataType.DECIMAL(18, 4).defaultValue(org.jooq.impl.DSL.inline("10.0000", org.jooq.impl.SQLDataType.DECIMAL)), this, "");
 
     /**
      * The column <code>thmodel.memberinfo.broker_ratio_video</code>.

+ 60 - 11
src/main/java/jooq/tables/records/AdsRecord.java

@@ -10,8 +10,8 @@ import jooq.tables.Ads;
 
 import org.jooq.Field;
 import org.jooq.Record1;
-import org.jooq.Record4;
-import org.jooq.Row4;
+import org.jooq.Record5;
+import org.jooq.Row5;
 import org.jooq.impl.UpdatableRecordImpl;
 
 
@@ -26,9 +26,9 @@ import org.jooq.impl.UpdatableRecordImpl;
     comments = "This class is generated by jOOQ"
 )
 @SuppressWarnings({ "all", "unchecked", "rawtypes" })
-public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record4<Integer, String, Integer, String> {
+public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record5<Integer, String, Integer, String, String> {
 
-    private static final long serialVersionUID = 1111711387;
+    private static final long serialVersionUID = -677080514;
 
     /**
      * Setter for <code>thmodel.ads.id</code>.
@@ -86,6 +86,20 @@ public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record4
         return (String) get(3);
     }
 
+    /**
+     * Setter for <code>thmodel.ads.detail</code>.
+     */
+    public void setDetail(String value) {
+        set(4, value);
+    }
+
+    /**
+     * Getter for <code>thmodel.ads.detail</code>.
+     */
+    public String getDetail() {
+        return (String) get(4);
+    }
+
     // -------------------------------------------------------------------------
     // Primary key information
     // -------------------------------------------------------------------------
@@ -99,23 +113,23 @@ public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record4
     }
 
     // -------------------------------------------------------------------------
-    // Record4 type implementation
+    // Record5 type implementation
     // -------------------------------------------------------------------------
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public Row4<Integer, String, Integer, String> fieldsRow() {
-        return (Row4) super.fieldsRow();
+    public Row5<Integer, String, Integer, String, String> fieldsRow() {
+        return (Row5) super.fieldsRow();
     }
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public Row4<Integer, String, Integer, String> valuesRow() {
-        return (Row4) super.valuesRow();
+    public Row5<Integer, String, Integer, String, String> valuesRow() {
+        return (Row5) super.valuesRow();
     }
 
     /**
@@ -150,6 +164,14 @@ public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record4
         return Ads.ADS.NAME;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Field<String> field5() {
+        return Ads.ADS.DETAIL;
+    }
+
     /**
      * {@inheritDoc}
      */
@@ -182,6 +204,14 @@ public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record4
         return getName();
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String component5() {
+        return getDetail();
+    }
+
     /**
      * {@inheritDoc}
      */
@@ -214,6 +244,14 @@ public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record4
         return getName();
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String value5() {
+        return getDetail();
+    }
+
     /**
      * {@inheritDoc}
      */
@@ -254,11 +292,21 @@ public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record4
      * {@inheritDoc}
      */
     @Override
-    public AdsRecord values(Integer value1, String value2, Integer value3, String value4) {
+    public AdsRecord value5(String value) {
+        setDetail(value);
+        return this;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public AdsRecord values(Integer value1, String value2, Integer value3, String value4, String value5) {
         value1(value1);
         value2(value2);
         value3(value3);
         value4(value4);
+        value5(value5);
         return this;
     }
 
@@ -276,12 +324,13 @@ public class AdsRecord extends UpdatableRecordImpl<AdsRecord> implements Record4
     /**
      * Create a detached, initialised AdsRecord
      */
-    public AdsRecord(Integer id, String pic, Integer parttypk, String name) {
+    public AdsRecord(Integer id, String pic, Integer parttypk, String name, String detail) {
         super(Ads.ADS);
 
         set(0, id);
         set(1, pic);
         set(2, parttypk);
         set(3, name);
+        set(4, detail);
     }
 }

+ 7 - 7
src/main/java/jooq/tables/records/MemberinfoRecord.java

@@ -28,7 +28,7 @@ import org.jooq.impl.UpdatableRecordImpl;
 @SuppressWarnings({ "all", "unchecked", "rawtypes" })
 public class MemberinfoRecord extends UpdatableRecordImpl<MemberinfoRecord> {
 
-    private static final long serialVersionUID = 372822805;
+    private static final long serialVersionUID = -1966246985;
 
     /**
      * Setter for <code>thmodel.memberinfo.PK</code>.
@@ -731,16 +731,16 @@ public class MemberinfoRecord extends UpdatableRecordImpl<MemberinfoRecord> {
     }
 
     /**
-     * Setter for <code>thmodel.memberinfo.broker_ratio_git</code>.
+     * Setter for <code>thmodel.memberinfo.broker_ratio_gift</code>.
      */
-    public void setBrokerRatioGit(BigDecimal value) {
+    public void setBrokerRatioGift(BigDecimal value) {
         set(50, value);
     }
 
     /**
-     * Getter for <code>thmodel.memberinfo.broker_ratio_git</code>.
+     * Getter for <code>thmodel.memberinfo.broker_ratio_gift</code>.
      */
-    public BigDecimal getBrokerRatioGit() {
+    public BigDecimal getBrokerRatioGift() {
         return (BigDecimal) get(50);
     }
 
@@ -854,7 +854,7 @@ public class MemberinfoRecord extends UpdatableRecordImpl<MemberinfoRecord> {
     /**
      * Create a detached, initialised MemberinfoRecord
      */
-    public MemberinfoRecord(Integer pk, Integer membtype, Integer membclass, String qrcode, String tel, String pass, String paypass, String pet, String hphoto, String photo, Integer area, String age, String id, Integer islive, Timestamp mdate, String token, Integer acc, Timestamp lastsign, Integer signdays, Integer introducerpk, String identify, String idA, String idB, String idC, String wid, BigDecimal coinA, BigDecimal coinIr, BigDecimal coinIv, BigDecimal coinIs, BigDecimal coinIrr, BigDecimal coinIvv, BigDecimal coinIss, BigDecimal coinIll, BigDecimal coinI, BigDecimal coinOr, BigDecimal coinOv, BigDecimal coinOs, BigDecimal coinOm, BigDecimal coinO, BigDecimal coinOi, BigDecimal coinOp, String phone, BigDecimal coinIrrr, BigDecimal coinIrrrm, BigDecimal incomeRatioGift, BigDecimal incomeRatioVideo, BigDecimal incomeRatioService, BigDecimal shareRatioGift, BigDecimal shareRatioVideo, BigDecimal shareRatioService, BigDecimal brokerRatioGit, BigDecimal brokerRatioVideo, BigDecimal brokerRatioService, BigDecimal coinShare, Integer canChat, String ip, String uuid) {
+    public MemberinfoRecord(Integer pk, Integer membtype, Integer membclass, String qrcode, String tel, String pass, String paypass, String pet, String hphoto, String photo, Integer area, String age, String id, Integer islive, Timestamp mdate, String token, Integer acc, Timestamp lastsign, Integer signdays, Integer introducerpk, String identify, String idA, String idB, String idC, String wid, BigDecimal coinA, BigDecimal coinIr, BigDecimal coinIv, BigDecimal coinIs, BigDecimal coinIrr, BigDecimal coinIvv, BigDecimal coinIss, BigDecimal coinIll, BigDecimal coinI, BigDecimal coinOr, BigDecimal coinOv, BigDecimal coinOs, BigDecimal coinOm, BigDecimal coinO, BigDecimal coinOi, BigDecimal coinOp, String phone, BigDecimal coinIrrr, BigDecimal coinIrrrm, BigDecimal incomeRatioGift, BigDecimal incomeRatioVideo, BigDecimal incomeRatioService, BigDecimal shareRatioGift, BigDecimal shareRatioVideo, BigDecimal shareRatioService, BigDecimal brokerRatioGift, BigDecimal brokerRatioVideo, BigDecimal brokerRatioService, BigDecimal coinShare, Integer canChat, String ip, String uuid) {
         super(Memberinfo.MEMBERINFO);
 
         set(0, pk);
@@ -907,7 +907,7 @@ public class MemberinfoRecord extends UpdatableRecordImpl<MemberinfoRecord> {
         set(47, shareRatioGift);
         set(48, shareRatioVideo);
         set(49, shareRatioService);
-        set(50, brokerRatioGit);
+        set(50, brokerRatioGift);
         set(51, brokerRatioVideo);
         set(52, brokerRatioService);
         set(53, coinShare);

+ 299 - 299
src/main/webapp/member/query_jinjiren.jsp

@@ -1,299 +1,299 @@
-<%@ page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
-<%request.setCharacterEncoding("utf-8");%>
-<%@ page language="java" import="java.sql.*,java.util.Arrays" %>
-<%@ page language="java" import="java.util.*, util.*" %>
-<%@ page language="java" import="system.*" %>
-<%@ page language="java" import="util.*" %>
-<%@ page language="java" import="biz.*" %>
-<%@ page language="java" import="net.sf.json.JSONObject" %>
-<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page"/>
-<%
-    String path = request.getContextPath();
-    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
-    String Sess_BrokerPK = ExtendString.getDBStr((String) session.getAttribute("BrokerPK"));
-    String userpk = ExtendString.getDBStr((String) session.getAttribute("userpk"));
-    String username = ExtendString.getDBStr((String) session.getAttribute("username"));
-    String MembType = ExtendString.getDBStr((String) session.getAttribute("MembType"));
-    String IsAdmin = ExtendString.getDBStr((String) session.getAttribute("IsAdmin"));
-    String sess_MemberPK = ExtendString.getDBStr((String) session.getAttribute("MemberPK"));
-    String sess_JiGouPK = ExtendString.getDBStr((String) session.getAttribute("JiGouPK"));
-
-    int items_per_page = 10;
-    javax.sql.rowset.CachedRowSet rs = null;
-    String operator = ExtendString.getDBStr(request.getParameter("operator"));
-    String superpk = ExtendString.getDBStr(request.getParameter("superpk")); //机构BrokerInfor.pk
-    String sql;
-    int rownum = 0;
-    if (superpk.equals("")) superpk = "-1";
-    if (sess_JiGouPK.length() == 0) sess_JiGouPK = "-1";
-    out.clear();
-    if (operator.equals("query")) {
-        int    PageIndex = Integer.parseInt(request.getParameter("PageIndex"));
-        String keyword   = ExtendString.getDBStr(request.getParameter("keyword"));
-
-        String BaseSQL = "select a.pk as brokepk, a.MemberPK, b.Tel, a.Name, a.addr, a.intro, a.linkMan, " +
-                "		 a.IsAdmin, a.Auth, b.MembType, b.Area, a.superPK, C.Name as AreaName, b.Phone, " +
-                "       d.Name as jigouname, b.qrcode, " +
-                "       CAST(FORMAT(a.ratio_V,0) as char) as ratio_V, " +
-                "       CAST(FORMAT(a.ratio_S,0) as char) as ratio_S, " +
-                "       CAST(FORMAT(a.ratio_L,0) as char) as ratio_L, " +
-                "       CAST(FORMAT(a.ratio_R,0) as char) as ratio_R, " +
-                "       DATE_FORMAT(b.MDate,'%Y-%m-%d %H:%i:%s') as MDate, " +
-                "       (Select count(*) From ModelInfo X, memberinfo Y where X.BrokePK = A.PK and X.memberpk=Y.PK and IfNull(Y.identify,'')<>'删除' ) as ModelCount " +
-                "from BrokerInfor a inner Join MemberInfo b on a.MemberPK = b.PK  " +
-                "	   Left Join (select PK, Name from datatypeinfo where typeName ='地区') C on b.Area = C.PK " +
-                "     Left Join BrokerInfor d on a.superPK = d.pk " +
-                "where b.MembType = " + thmodel.MEMTYPE_JinJiRen + "  ";
-        //平台帐号可以查询所有经纪人,其它只能查看本机构(+下属机构)的经纪人
-        if (MembType.equals(thmodel.MEMTYPE_PingTai)) {
-            //无需添加条件
-        } else if (MembType.equals(thmodel.MEMTYPE_JiGou) || MembType.equals(thmodel.MEMTYPE_JinJiRen))
-            BaseSQL = BaseSQL + String.format(" and a.BrokePK = %s or a.superPK=%s ", sess_JiGouPK, sess_JiGouPK);
-        else //应该不会发生
-            BaseSQL = BaseSQL + String.format(" and a.BrokePK = %s ", Sess_BrokerPK);
-
-        if (keyword.length() > 0) {
-            BaseSQL += String.format(" and (b.Tel like '%%%s%%' or a.Name like '%%%s%%' or  d.Name like '%%%s%%') ",
-                                     keyword, keyword, keyword);
-        }
-        BaseSQL = BaseSQL + "Order by b.MDate Desc ";
-
-        if (PageIndex == -1)
-            sql = BaseSQL + "  LIMIT 0, " + String.valueOf(items_per_page);
-        else
-            sql = BaseSQL + " LIMIT " + String.valueOf(items_per_page * PageIndex)
-                    + "," + String.valueOf(items_per_page);
-
-        List<JSONObject> jsonList = DBRecordsPack.Pack(db, sql);
-        if (PageIndex == -1) {
-            rs = db.executeQuery("Select Count(*) C from (" + BaseSQL + ") as t_cc ");
-            if ((rs != null) && rs.next()) {
-                JSONObject jsonObj = new JSONObject();
-                jsonObj.put("result", "CachedRowSet");
-                jsonObj.put("recordcount", rs.getInt(1));
-                jsonObj.put("pageindex", 0);
-                jsonList.add(jsonObj);
-            }
-        }
-        out.clear();
-        out.print(jsonList);
-        return;
-    }
-
-%>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-    <base href="<%=basePath %>"/>
-    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7"/>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css"/>
-    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/WdatePicker.css"/>
-    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/skin_/table.css"/>
-    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/jquery.grid.css"/>
-    <title>经纪人查询</title>
-</head>
-<body>
-<div id="container">
-    <div id="hd"></div>
-    <div id="bd">
-        <div id="main">
-            <div class="search-box ue-clear">
-                <div class="search-area">
-                    <div class="kv-item ue-clear">
-                        <label>关键字:</label>
-                        <span></span>
-                        <input type="text" name="keyword" style="width:200px" placeholder="关键字"/>
-                    </div>
-                </div>
-                <div class="search-button">
-                    <span></span>
-                    <input class="button" id="button" type="button" value="搜索一下" onClick="ButtonClick();"/>
-                </div>
-            </div>
-            <div class="table">
-                <div class="grid"></div>
-                <div class="pagination"></div>
-            </div>
-        </div>
-    </div>
-</div>
-
-</body>
-<script type="text/javascript" src="<%=basePath%>js/jquery.js"></script>
-<script type="text/javascript" src="<%=basePath%>js/global.js"></script>
-<script type="text/javascript" src="<%=basePath%>js/jquery.select.js"></script>
-<script type="text/javascript" src="<%=basePath%>js/core.js"></script>
-<script type="text/javascript" src="<%=basePath%>js/jquery.pagination.js"></script>
-<script type="text/javascript" src="<%=basePath%>js/jquery.grid.js"></script>
-<script type="text/javascript" src="<%=basePath%>js/WdatePicker.js"></script>
-<script type="text/javascript" src="<%=basePath%>js/zDrag.js"></script>
-<script type="text/javascript" src="<%=basePath%>js/zDialog.js"></script>
-<script type="text/javascript">
-    $('select').select();
-    var head = [
-        {
-            label: '机构',
-            width: 120,
-            name: 'jigouname'
-        },
-        {
-            label: '帐号',
-            width: 110,
-            name: 'Tel'
-        },
-        {
-            label: '名称',
-            width: 90,
-            name: 'Name'
-        },
-        {
-            label: '电话',
-            width: 110,
-            name: 'Phone'
-        },
-        {
-            label: '视频分成(%)',
-            width: 50,
-            name: 'ratio_V'
-        },
-        {
-            label: '人才服务分成(%)',
-            width: 50,
-            name: 'ratio_S'
-        },
-        {
-            label: '队长分成(%)',
-            width: 80,
-            name: 'ratio_L'
-        },
-        {
-            label: '红包分成(%)',
-            width: 80,
-            name: 'ratio_R'
-        },
-        {
-            label: '模特数',
-            width: 80,
-            name: 'ModelCount'
-        },
-        {
-            label: '邀请码',
-            width: 70
-        },
-        {
-            label: '注册日期',
-            width: 150,
-            name: 'MDate'
-        }
-    ];
-
-    function SetRowsetInfo(rowCount, CurPage) {
-        $('.pagination').pagination(rowCount, {
-            items_per_page: <%=items_per_page %>,
-            current_page: CurPage,
-            callback: function (page) {
-                DoQuery(page);
-            },
-            display_msg: false
-        });
-    }
-
-    var tbody = new Array();
-
-    //superPK 
-    function DoQuery(PageIndex) {
-        $('.grid').Grid('addLoading');
-        keyword = document.all.keyword.value;
-        $.post("<%=basePath%>member/query_jinjiren.jsp",
-            {
-                operator: "query",
-                keyword: keyword,
-                PageIndex: PageIndex
-            },
-            function (data, status) {
-                var obj = eval('(' + data + ')');
-                if ((obj.length == 0) || (obj[0].result != "success")) {
-                    $('.grid').Grid('setData', null, head);
-                    SetRowsetInfo(1, 0);
-                }
-                else {
-                    tbody.length = 0;
-                    for (var row = 0; row < obj.length; row++) {
-                        if (obj[row].result == "success") {
-                            var fields = [];
-                            fields[0] = obj[row].jigouname;
-                            fields[1] = obj[row].tel;
-                            fields[2] = obj[row].name;
-                            fields[3] = obj[row].phone;
-                            fields[4] = obj[row].ratio_v;
-                            fields[5] = obj[row].ratio_s;
-                            fields[6] = obj[row].ratio_l;
-                            fields[7] = obj[row].ratio_r;
-                            fields[8] = obj[row].modelcount;
-                            fields[9] = obj[row].qrcode;
-                            fields[10] = obj[row].mdate;
-                            fields[11] = [
-                                {
-                                    label: '模特',
-                                    brokepk: obj[row].brokepk,
-                                    memberpk: obj[row].memberpk,
-                                    onclick: function () {
-                                        doViewModel(this.brokepk, this.memberpk);
-                                    }
-                                }
-                            ];
-                            tbody[row] = fields;
-                        }
-                        else if (obj[row].result == "CachedRowSet") {
-                            SetRowsetInfo(obj[row].recordcount, obj[row].pageindex);
-                        }
-                    }
-                    $('.grid').Grid('setData', tbody, head);
-                }
-            });
-    }
-
-    function ButtonClick() {
-        DoQuery(-1);
-    }
-
-    function doViewModel(BrokePK, BMemberPK) {
-        var diag = new zDialog();
-        diag.Top = 20;
-        diag.Width = "90%";
-        diag.Height = "90%";
-        diag.Title = "模特";
-        diag.URL = "<%=basePath%>member/model.jsp?brokepk=" + BrokePK + "&bmemberpk=" + BMemberPK;
-        diag.OnClose = function (zWindow) {
-            if (zWindow.result == 1)
-                DoQuery("", -1);
-        }
-        diag.show();
-    }
-
-    H = $(window).height() - $(".grid").offset().top - 100;
-    if (H < 200) H = 200;
-    $('.grid').Grid({
-        thead: head,
-        tbody: null,
-        height: H,
-        operator: {
-            type: "normal",
-            width: 120
-        }
-    });
-
-    $('.grid').Grid('addLoading');
-    $('.grid').Grid('setData', null, head);
-
-    $(function () {
-        $("#button").css("height", 28);
-        DoQuery(-1);
-    });
-
-
-</script>
-
-</html>
+<%@ page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
+<%request.setCharacterEncoding("utf-8");%>
+<%@ page language="java" import="java.sql.*,java.util.Arrays" %>
+<%@ page language="java" import="java.util.*, util.*" %>
+<%@ page language="java" import="system.*" %>
+<%@ page language="java" import="util.*" %>
+<%@ page language="java" import="biz.*" %>
+<%@ page language="java" import="net.sf.json.JSONObject" %>
+<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page"/>
+<%
+    String path = request.getContextPath();
+    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
+    String Sess_BrokerPK = ExtendString.getDBStr((String) session.getAttribute("BrokerPK"));
+    String userpk = ExtendString.getDBStr((String) session.getAttribute("userpk"));
+    String username = ExtendString.getDBStr((String) session.getAttribute("username"));
+    String MembType = ExtendString.getDBStr((String) session.getAttribute("MembType"));
+    String IsAdmin = ExtendString.getDBStr((String) session.getAttribute("IsAdmin"));
+    String sess_MemberPK = ExtendString.getDBStr((String) session.getAttribute("MemberPK"));
+    String sess_JiGouPK = ExtendString.getDBStr((String) session.getAttribute("JiGouPK"));
+
+    int items_per_page = 10;
+    javax.sql.rowset.CachedRowSet rs = null;
+    String operator = ExtendString.getDBStr(request.getParameter("operator"));
+    String superpk = ExtendString.getDBStr(request.getParameter("superpk")); //机构BrokerInfor.pk
+    String sql;
+    int rownum = 0;
+    if (superpk.equals("")) superpk = "-1";
+    if (sess_JiGouPK.length() == 0) sess_JiGouPK = "-1";
+    out.clear();
+    if (operator.equals("query")) {
+        int    PageIndex = Integer.parseInt(request.getParameter("PageIndex"));
+        String keyword   = ExtendString.getDBStr(request.getParameter("keyword"));
+
+        String BaseSQL = "select a.pk as brokepk, a.MemberPK, b.Tel, a.Name, a.addr, a.intro, a.linkMan, " +
+                "		 a.IsAdmin, a.Auth, b.MembType, b.Area, a.superPK, C.Name as AreaName, b.Phone, " +
+                "       d.Name as jigouname, b.qrcode, " +
+                "       CAST(FORMAT(b.broker_ratio_video,0) as char) as ratio_V, " +
+                "       CAST(FORMAT(b.broker_ratio_service,0) as char) as ratio_S, " +
+                "       CAST(FORMAT(a.ratio_L,0) as char) as ratio_L, " +
+                "       CAST(FORMAT(b.broker_ratio_gift,0) as char) as ratio_R, " +
+                "       DATE_FORMAT(b.MDate,'%Y-%m-%d %H:%i:%s') as MDate, " +
+                "       (Select count(*) From ModelInfo X, memberinfo Y where X.BrokePK = A.PK and X.memberpk=Y.PK and IfNull(Y.identify,'')<>'删除' ) as ModelCount " +
+                "from BrokerInfor a inner Join MemberInfo b on a.MemberPK = b.PK  " +
+                "	   Left Join (select PK, Name from datatypeinfo where typeName ='地区') C on b.Area = C.PK " +
+                "     Left Join BrokerInfor d on a.superPK = d.pk " +
+                "where b.MembType = " + thmodel.MEMTYPE_JinJiRen + "  ";
+        //平台帐号可以查询所有经纪人,其它只能查看本机构(+下属机构)的经纪人
+        if (MembType.equals(thmodel.MEMTYPE_PingTai)) {
+            //无需添加条件
+        } else if (MembType.equals(thmodel.MEMTYPE_JiGou) || MembType.equals(thmodel.MEMTYPE_JinJiRen))
+            BaseSQL = BaseSQL + String.format(" and a.BrokePK = %s or a.superPK=%s ", sess_JiGouPK, sess_JiGouPK);
+        else //应该不会发生
+            BaseSQL = BaseSQL + String.format(" and a.BrokePK = %s ", Sess_BrokerPK);
+
+        if (keyword.length() > 0) {
+            BaseSQL += String.format(" and (b.Tel like '%%%s%%' or a.Name like '%%%s%%' or  d.Name like '%%%s%%') ",
+                                     keyword, keyword, keyword);
+        }
+        BaseSQL = BaseSQL + "Order by b.MDate Desc ";
+
+        if (PageIndex == -1)
+            sql = BaseSQL + "  LIMIT 0, " + String.valueOf(items_per_page);
+        else
+            sql = BaseSQL + " LIMIT " + String.valueOf(items_per_page * PageIndex)
+                    + "," + String.valueOf(items_per_page);
+
+        List<JSONObject> jsonList = DBRecordsPack.Pack(db, sql);
+        if (PageIndex == -1) {
+            rs = db.executeQuery("Select Count(*) C from (" + BaseSQL + ") as t_cc ");
+            if ((rs != null) && rs.next()) {
+                JSONObject jsonObj = new JSONObject();
+                jsonObj.put("result", "CachedRowSet");
+                jsonObj.put("recordcount", rs.getInt(1));
+                jsonObj.put("pageindex", 0);
+                jsonList.add(jsonObj);
+            }
+        }
+        out.clear();
+        out.print(jsonList);
+        return;
+    }
+
+%>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <base href="<%=basePath %>"/>
+    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7"/>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css"/>
+    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/WdatePicker.css"/>
+    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/skin_/table.css"/>
+    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/jquery.grid.css"/>
+    <title>经纪人查询</title>
+</head>
+<body>
+<div id="container">
+    <div id="hd"></div>
+    <div id="bd">
+        <div id="main">
+            <div class="search-box ue-clear">
+                <div class="search-area">
+                    <div class="kv-item ue-clear">
+                        <label>关键字:</label>
+                        <span></span>
+                        <input type="text" name="keyword" style="width:200px" placeholder="关键字"/>
+                    </div>
+                </div>
+                <div class="search-button">
+                    <span></span>
+                    <input class="button" id="button" type="button" value="搜索一下" onClick="ButtonClick();"/>
+                </div>
+            </div>
+            <div class="table">
+                <div class="grid"></div>
+                <div class="pagination"></div>
+            </div>
+        </div>
+    </div>
+</div>
+
+</body>
+<script type="text/javascript" src="<%=basePath%>js/jquery.js"></script>
+<script type="text/javascript" src="<%=basePath%>js/global.js"></script>
+<script type="text/javascript" src="<%=basePath%>js/jquery.select.js"></script>
+<script type="text/javascript" src="<%=basePath%>js/core.js"></script>
+<script type="text/javascript" src="<%=basePath%>js/jquery.pagination.js"></script>
+<script type="text/javascript" src="<%=basePath%>js/jquery.grid.js"></script>
+<script type="text/javascript" src="<%=basePath%>js/WdatePicker.js"></script>
+<script type="text/javascript" src="<%=basePath%>js/zDrag.js"></script>
+<script type="text/javascript" src="<%=basePath%>js/zDialog.js"></script>
+<script type="text/javascript">
+    $('select').select();
+    var head = [
+        {
+            label: '机构',
+            width: 120,
+            name: 'jigouname'
+        },
+        {
+            label: '帐号',
+            width: 110,
+            name: 'Tel'
+        },
+        {
+            label: '名称',
+            width: 90,
+            name: 'Name'
+        },
+        {
+            label: '电话',
+            width: 110,
+            name: 'Phone'
+        },
+        {
+            label: '视频分成(%)',
+            width: 50,
+            name: 'ratio_V'
+        },
+        {
+            label: '人才服务分成(%)',
+            width: 50,
+            name: 'ratio_S'
+        },
+        {
+            label: '队长分成(%)',
+            width: 80,
+            name: 'ratio_L'
+        },
+        {
+            label: '红包分成(%)',
+            width: 80,
+            name: 'ratio_R'
+        },
+        {
+            label: '模特数',
+            width: 80,
+            name: 'ModelCount'
+        },
+        {
+            label: '邀请码',
+            width: 70
+        },
+        {
+            label: '注册日期',
+            width: 150,
+            name: 'MDate'
+        }
+    ];
+
+    function SetRowsetInfo(rowCount, CurPage) {
+        $('.pagination').pagination(rowCount, {
+            items_per_page: <%=items_per_page %>,
+            current_page: CurPage,
+            callback: function (page) {
+                DoQuery(page);
+            },
+            display_msg: false
+        });
+    }
+
+    var tbody = new Array();
+
+    //superPK 
+    function DoQuery(PageIndex) {
+        $('.grid').Grid('addLoading');
+        keyword = document.all.keyword.value;
+        $.post("<%=basePath%>member/query_jinjiren.jsp",
+            {
+                operator: "query",
+                keyword: keyword,
+                PageIndex: PageIndex
+            },
+            function (data, status) {
+                var obj = eval('(' + data + ')');
+                if ((obj.length == 0) || (obj[0].result != "success")) {
+                    $('.grid').Grid('setData', null, head);
+                    SetRowsetInfo(1, 0);
+                }
+                else {
+                    tbody.length = 0;
+                    for (var row = 0; row < obj.length; row++) {
+                        if (obj[row].result == "success") {
+                            var fields = [];
+                            fields[0] = obj[row].jigouname;
+                            fields[1] = obj[row].tel;
+                            fields[2] = obj[row].name;
+                            fields[3] = obj[row].phone;
+                            fields[4] = obj[row].ratio_v;
+                            fields[5] = obj[row].ratio_s;
+                            fields[6] = obj[row].ratio_l;
+                            fields[7] = obj[row].ratio_r;
+                            fields[8] = obj[row].modelcount;
+                            fields[9] = obj[row].qrcode;
+                            fields[10] = obj[row].mdate;
+                            fields[11] = [
+                                {
+                                    label: '模特',
+                                    brokepk: obj[row].brokepk,
+                                    memberpk: obj[row].memberpk,
+                                    onclick: function () {
+                                        doViewModel(this.brokepk, this.memberpk);
+                                    }
+                                }
+                            ];
+                            tbody[row] = fields;
+                        }
+                        else if (obj[row].result == "CachedRowSet") {
+                            SetRowsetInfo(obj[row].recordcount, obj[row].pageindex);
+                        }
+                    }
+                    $('.grid').Grid('setData', tbody, head);
+                }
+            });
+    }
+
+    function ButtonClick() {
+        DoQuery(-1);
+    }
+
+    function doViewModel(BrokePK, BMemberPK) {
+        var diag = new zDialog();
+        diag.Top = 20;
+        diag.Width = "90%";
+        diag.Height = "90%";
+        diag.Title = "模特";
+        diag.URL = "<%=basePath%>member/model.jsp?brokepk=" + BrokePK + "&bmemberpk=" + BMemberPK;
+        diag.OnClose = function (zWindow) {
+            if (zWindow.result == 1)
+                DoQuery("", -1);
+        }
+        diag.show();
+    }
+
+    H = $(window).height() - $(".grid").offset().top - 100;
+    if (H < 200) H = 200;
+    $('.grid').Grid({
+        thead: head,
+        tbody: null,
+        height: H,
+        operator: {
+            type: "normal",
+            width: 120
+        }
+    });
+
+    $('.grid').Grid('addLoading');
+    $('.grid').Grid('setData', null, head);
+
+    $(function () {
+        $("#button").css("height", 28);
+        DoQuery(-1);
+    });
+
+
+</script>
+
+</html>

+ 156 - 0
src/main/webapp/system/addAd.jsp

@@ -0,0 +1,156 @@
+<%@ page import="util.ExtendString" %>
+<%@ page import="org.jooq.impl.DSL" %>
+<%@ page import="dbconnection.DbConnection" %>
+<%@ page import="org.jooq.DSLContext" %>
+<%@ page import="static jooq.Tables.ADS" %>
+<%@ page import="org.apache.commons.lang.StringUtils" %>
+<%@ page import="org.jooq.Record" %>
+<%@ page import="net.sf.json.JSONObject" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+    int id = ExtendString.getInt(request.getParameter("id"));
+    String operator = ExtendString.getDBStr(request.getParameter("operator"));
+    String pic = ExtendString.getDBStr(request.getParameter("pic"));
+    String detail = ExtendString.getDBStr(request.getParameter("detail"));
+    String name = ExtendString.getDBStr(request.getParameter("name"));
+    DSLContext ctx = DSL.using(DbConnection.getPara("MySQLURL"));
+
+    if ("save".equals(operator)) {
+        boolean success;
+        if (id > 0) {
+            success = ctx.update(ADS)
+                    .set(ADS.NAME, name)
+                    .set(ADS.DETAIL, detail)
+                    .set(ADS.PIC, pic)
+                    .where(ADS.ID.equal(id))
+                    .execute() > 0;
+        } else {
+            success = ctx.insertInto(ADS, ADS.NAME, ADS.DETAIL, ADS.PIC).values(name, detail, pic).execute() > 0;
+        }
+        response.setContentType("application/json");
+        out.print("{\"success\":" + success + "}");
+        ctx.close();
+        return;
+    }
+
+    if (id > 0) {
+        Record record = ctx.select().from(ADS).where(ADS.ID.equal(id)).fetchAny();
+        if (record != null) {
+            pic = record.get(ADS.PIC);
+            detail = record.get(ADS.DETAIL);
+            name = record.get(ADS.NAME);
+        }
+    }
+    JSONObject jsonObject = new JSONObject();
+    jsonObject.put("name", name);
+    jsonObject.put("detail", detail);
+    jsonObject.put("pic", pic);
+    ctx.close();
+%>
+<html>
+<head>
+    <title>编辑</title>
+    <base href="${pageContext.request.contextPath}"/>
+    <meta xml:base="">
+    <title>活动信息</title>
+    <%@include file="/_common.jsp" %>
+    <script charset="utf-8" src="${pageContext.request.contextPath}/js/kindeditor.js"></script>
+    <script charset="utf-8" src="${pageContext.request.contextPath}/js/lang/zh_CN.js"></script>
+    <style>
+        .pic {
+            max-width: 100%;
+            max-height: 400px;
+        }
+    </style>
+</head>
+<body>
+<div id="app">
+    <el-form size="small">
+        <el-form-item label="名称">
+            <el-input v-model="name"></el-input>
+        </el-form-item>
+        <el-form-item label="图片">
+            <el-input v-model="pic" disabled></el-input>
+            <el-upload action="${pageContext.request.contextPath}/UpLoad?dir=image&noPrefix=true" accep="image/*"
+                       :show-file-list="false" :on-success="onSuccess">
+                <el-button size="small" type="primary">点击上传</el-button>
+            </el-upload>
+        </el-form-item>
+        <el-form-item label="详情">
+            <textarea id="textarea" style="width: 100%;height:500px;" v-model="detail"></textarea>
+        </el-form-item>
+        <el-form-item>
+            <el-button @click="cancel">取 消</el-button>
+            <el-button type="primary" @click="submit">保 存</el-button>
+        </el-form-item>
+    </el-form>
+</div>
+<script>
+    var info =<%=jsonObject%>;
+    new Vue({
+        el: '#app',
+        data: {
+            id: '<%=id%>',
+            name: '<%=name%>',
+            pic: '<%=pic%>',
+            detail: info.detail
+        },
+        mounted: function () {
+            var self = this;
+            KindEditor.ready(function (K) {
+                window.K = K;
+                K.create("#textarea", {
+                    resizeType: 0,
+                    minHeight: 50,
+                    formatUploadUrl: false,
+                    newlineTag: 'br',
+                    cssPath: '${pageContext.request.contextPath}/js/plugins/code/prettify.css',
+                    uploadJson: '${pageContext.request.contextPath}/UpLoad',
+                    allowFileManager: false,
+                    afterCreate: function () {
+                    },
+                    afterBlur: function () {
+                        this.sync();
+                    }
+                });
+            })
+        },
+        methods: {
+            cancel: function () {
+                parentDialog.close();
+            },
+            onSuccess: function (res) {
+                this.pic = res.url;
+            },
+            submit: function () {
+                if (!this.name) {
+                    alert('请填写名称');
+                    return;
+                }
+                if (!this.pic) {
+                    alert('请上传图片');
+                    return;
+                }
+                $.post({
+                    url: '',
+                    data: {
+                        operator: 'save',
+                        id: this.id,
+                        pic: this.pic,
+                        detail: K('#textarea').val(),
+                        name: this.name
+                    },
+                    success: function () {
+                        window.result = 1;
+                        parentDialog.close();
+                    },
+                    error: function () {
+                        alert('保存失败请稍后再试')
+                    }
+                })
+            }
+        }
+    })
+</script>
+</body>
+</html>

+ 14 - 3
src/main/webapp/system/dancequeen.jsp

@@ -81,7 +81,7 @@
 </head>
 <body>
 <div id="app">
-    <h3>广告&nbsp;&nbsp;<el-button size="mini" type="primary" @click="onAddAds">添加</el-button>
+    <h3>广告&nbsp;&nbsp;<el-button size="mini" type="primary" @click="edit">添加</el-button>
     </h3>
     <el-table :data="ads" size="small">
         <el-table-column prop="name" label="名称"></el-table-column>
@@ -90,8 +90,9 @@
                 <el-button size="small" type="text" @click="preview(row.pic)">查看</el-button>
             </template>
         </el-table-column>
-        <el-table-column width="80" align="center" label="删除">
+        <el-table-column width="80" align="center" label="操作">
             <template slot-scope="{row}">
+                <el-button size="small" type="text" @click="edit(row.id)">编辑</el-button>
                 <el-button size="small" type="text" @click="delAd(row.id)">删除</el-button>
             </template>
         </el-table-column>
@@ -127,7 +128,7 @@
     <el-dialog
             title="添加广告"
             :visible.sync="showAdDialog"
-            width="30%">
+            width="90%">
         <el-form>
             <el-form-item label="名称">
                 <el-input v-model="name"></el-input>
@@ -189,6 +190,16 @@
                     }
                 })
             },
+            edit: function (id) {
+                id = id ? id : '';
+                this.showIframe({
+                    url: 'addAd.jsp?id=' + id,
+                    title: '编辑',
+                    onClose: function () {
+                        window.location.reload();
+                    }.bind(this)
+                })
+            },
             onSuccess: function (res) {
                 this.pic = res.url;
             },