Procházet zdrojové kódy

用户行为记录优化修复

huangzhiguo před 2 roky
rodič
revize
eb724bb4d0

+ 3 - 3
src/main/java/com/caimei/modules/user/service/CmBehaviorRecordService.java

@@ -45,11 +45,11 @@ public class CmBehaviorRecordService extends CrudService<CmBehaviorRecordDao, Cm
         if (pageNo == 1) {
             number = 0;
         } else {
-            number = pageNo * pageSize;
+            number = (pageNo - 1) * pageSize;
         }
         List<CmBehaviorRecord> behaviorList = new ArrayList<>();
-        for (int i = 0; i < list.size() ; i++) {
-            if (i >= number && i <= number+pageSize) {
+        for (int i = 0; i <= list.size()-1 ; i++) {
+            if (i >= number && i < number+pageSize) {
                 behaviorList.add(list.get(i));
             }
         }

+ 6 - 6
src/main/resources/mappings/modules/user/CmBehaviorRecordMapper.xml

@@ -45,7 +45,7 @@
                 AND b.IP = #{IP}
             </if>
             <if test="name != null and name != ''">
-                AND c.sname = #{name} or s.name = #{name}
+                AND c.name = #{name} or s.name = #{name}
             </if>
             <if test="userIdentity != null and userIdentity != ''">
                 <if test="userIdentity == 2">
@@ -58,8 +58,8 @@
                     AND  b.userID = 0
                 </if>
             </if>
-            <if test="linkMan != null and linkMan != ''">
-                AND (c.linkMan = #{linkMan} or s.linkMan = #{linkMan})
+            <if test="userName != null and userName != ''">
+                AND u.userName = #{userName}
             </if>
             <if test="contractMobile != null and contractMobile != ''">
                 AND (c.contractMobile = #{contractMobile} or s.contractMobile = #{contractMobile})
@@ -120,8 +120,8 @@
                     AND  b.userID = 0
                 </if>
             </if>
-            <if test="linkMan != null and linkMan != ''">
-                AND (c.linkMan = #{linkMan} or s.linkMan = #{linkMan})
+            <if test="userName != null and userName != ''">
+                AND u.userName = #{userName}
             </if>
             <if test="contractMobile != null and contractMobile != ''">
                 AND (c.contractMobile = #{contractMobile} or s.contractMobile = #{contractMobile})
@@ -201,7 +201,7 @@
                 AND accessDate = #{accessDate}
             </if>
         </where>
-        GROUP BY accessDate ORDER BY accessTime ASC
+        GROUP BY accessDate ORDER BY accessDate DESC
     </select>
 
     <select id="behaviorAgency" resultType="com.caimei.modules.user.entity.CmBehaviorRecord">

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/user/behaviorRecordList.jsp

@@ -44,7 +44,7 @@
         <label>IP:</label>
             <form:input path="IP" htmlEscape="false" maxlength="15" cssStyle="width: 150px" class="input-mini"/>
         <label>公司名称:</label>
-            <form:input path="name" htmlEscape="false" maxlength="11" cssStyle="width: 150px" class="input-mini"/>
+            <form:input path="name" htmlEscape="false" cssStyle="width: 150px" class="input-mini"/>
         <label>公司类型:</label>
             <form:select path="userIdentity" cssStyle="width: 150px" class="input-medium required">
                 <form:option value="" label="请选择"/>
@@ -53,7 +53,7 @@
                 <form:option value="1" label="游客"/>
             </form:select>
         <label>联系人:</label>
-            <form:input path="linkMan" htmlEscape="false" maxlength="20" cssStyle="width: 150px" class="input-small"/>
+            <form:input path="userName" htmlEscape="false" maxlength="20" cssStyle="width: 150px" class="input-small"/>
         <label>手机号码:</label>
             <form:input path="contractMobile" htmlEscape="false" maxlength="20" cssStyle="width: 150px" class="input-small"/>
         <label>协销:</label>