|
@@ -1769,7 +1769,7 @@
|
|
|
SELECT
|
|
|
(
|
|
|
SELECT
|
|
|
- count(1)
|
|
|
+ count(DISTINCT l.user_id)
|
|
|
FROM
|
|
|
fs_course_watch_log l
|
|
|
LEFT JOIN company_user ON l.company_user_id = company_user.user_id
|
|
@@ -1787,13 +1787,20 @@
|
|
|
<if test="videoId != null and videoId != ''">
|
|
|
AND l.video_id = #{videoId}
|
|
|
</if>
|
|
|
+ <if test="startTime != null and startTime !='' ">
|
|
|
+ and l.create_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and l.create_time <= #{endTime}
|
|
|
+ </if>
|
|
|
+ -- 单独通过销售id查询
|
|
|
<if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND l.user_id = #{companyUserId}
|
|
|
+ AND l.company_user_id = #{companyUserId}
|
|
|
</if>
|
|
|
) as courseWatchNum,
|
|
|
(
|
|
|
SELECT
|
|
|
- count(1)
|
|
|
+ count(DISTINCT l.user_id)
|
|
|
FROM
|
|
|
fs_course_watch_log l
|
|
|
LEFT JOIN company_user ON l.company_user_id = company_user.user_id
|
|
@@ -1811,9 +1818,15 @@
|
|
|
<if test="videoId != null and videoId != ''">
|
|
|
AND l.video_id = #{videoId}
|
|
|
</if>
|
|
|
+ <if test="startTime != null and startTime !='' ">
|
|
|
+ and l.create_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and l.create_time <= #{endTime}
|
|
|
+ </if>
|
|
|
-- 单独通过销售id查询
|
|
|
<if test="companyUserId != null and companyUserId != ''">
|
|
|
- AND l.user_id = #{companyUserId}
|
|
|
+ AND l.company_user_id = #{companyUserId}
|
|
|
</if>
|
|
|
) as courseCompleteNum
|
|
|
</select>
|