educode_sales 1.10.35 → 1.10.36
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 202bd95e90b6448156fe54662adb177661b35bfe393c8bfd55b2c7ea1b9b969f
|
4
|
+
data.tar.gz: 8bfdc6c034e250245520c6979ca16b2250910088c6b1a8271c78dc83f5db27d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0078407305994e98a88a1bacc27a068da6fc84fb206de4f5315ec802d5a8802829aa73eecbe954d94d3e85cdc04b94c5622d8c1f0891754d304bbc43aebde484'
|
7
|
+
data.tar.gz: 0bf901ecf33bd91b849e9e79571f618ef70ebcc0c66b5b53931d7112cbd3e2e78f8cb6d28f3fbbdbf54e33a6694eeb0dd67930e36679d3e0de8f56a5593226bf
|
@@ -54,15 +54,15 @@ module EducodeSales
|
|
54
54
|
level = @current_admin.role.role_areas.find_by(clazz: '方案管理').try(:level)
|
55
55
|
case level
|
56
56
|
when '自己'
|
57
|
-
idea_ids = Idea.
|
57
|
+
idea_ids = Idea.not_deleted.select { |d| Array(d.other_staff_ids).include?(@current_admin.id) || d.sale_staff_id == @current_admin.id || Array(d.assist_staff_ids).include?(@current_admin.id) || d.staff_id == @current_admin.id }.map { |d| d.id }
|
58
58
|
@ideas = Idea.where("educode_sales_ideas.creator_id = ? OR educode_sales_ideas.id in (?)", @current_admin.id, idea_ids)
|
59
59
|
when '区域'
|
60
60
|
# 查看区域商机,需要排除掉其它人员手上的监管学校
|
61
61
|
other_staff_school_id = EducodeSales::StaffSchool.where.not(staff_id: @current_admin.id).where("school_id IN (SELECT school_id FROM educode_sales_staff_schools WHERE staff_id = #{@current_admin.id}) IS NOT TRUE").distinct.pluck :school_id
|
62
62
|
|
63
63
|
school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id) - other_staff_school_id
|
64
|
-
idea_ids = Idea.
|
65
|
-
@ideas = @ideas.
|
64
|
+
idea_ids = Idea.not_deleted.select { |d| Array(d.other_staff_ids).include?(@current_admin.id) || d.sale_staff_id == @current_admin.id || Array(d.assist_staff_ids).include?(@current_admin.id) || d.staff_id == @current_admin.id }.map { |d| d.id }
|
65
|
+
@ideas = @ideas.left_joins(department: :school).where("schools.id in (?) OR educode_sales_ideas.creator_id = ? OR educode_sales_ideas.id in (?)", school_ids, @current_admin.id, idea_ids)
|
66
66
|
else
|
67
67
|
@ideas = @ideas
|
68
68
|
end
|