浏览代码

社群权限放开

zhaoxian 2 年之前
父节点
当前提交
ef35931927

+ 4 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -429,6 +429,10 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         List<Long> promoterIds = promoterService.selectPromoterIdList(userList);
         if (Check.isNotNull(promoterIds)) {
             data.put("promoterCount", promoterIds.size());//达人总数
+            if (Check.isNull(userList)) {
+                //社群查所有
+                promoterIds = null;
+            }
             JSONObject Sample = kuaishouItemCollectSamplesMapper.queryTheNumberOfCompletedJobs(promoterIds, startDate, endDate);
             data.put("completeCount", Sample.getInteger("completeCount"));//完成作业数
             data.put("completeRate", Sample.getString("completeRate"));//合格作业率

+ 14 - 10
ruixuan-live/src/main/resources/mapper/isc/KuaishouItemCollectSamplesMapper.xml

@@ -510,22 +510,26 @@
         WHERE DATE_FORMAT(create_time, '%Y-%m-%d') >= #{startDate}
         AND DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{endDate}
         AND collect_sample_status = 7
-        AND promoter_id in
-        <foreach collection="promoterIds" item="item" separator=","
-                 open="(" close=")">
-            #{item}
-        </foreach>
+        <if test="promoterIds != null and promoterIds.size() > 0 ">
+            AND promoter_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t1
         LEFT JOIN
         (SELECT IFNULL(SUM(sample_count), 0) as 'allCount'
         FROM kuaishou_item_collect_samples
         WHERE DATE_FORMAT(create_time, '%Y-%m-%d') >= #{startDate}
         AND DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{endDate}
-        AND promoter_id in
-        <foreach collection="promoterIds" item="item" separator=","
-                 open="(" close=")">
-            #{item}
-        </foreach>
+        <if test="promoterIds != null and promoterIds.size() > 0 ">
+            AND promoter_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         ) t2 on 1 = 1
     </select>