educode_sales 1.10.36 → 1.10.37

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: 202bd95e90b6448156fe54662adb177661b35bfe393c8bfd55b2c7ea1b9b969f
4
- data.tar.gz: 8bfdc6c034e250245520c6979ca16b2250910088c6b1a8271c78dc83f5db27d3
3
+ metadata.gz: b46b08f02fd4495dc7dcbe644409b09c38fd9936ce81c574d8747eadeb935dab
4
+ data.tar.gz: 874c54125a516d0631812e60fb439418cf050550dfd40166777762d4e6b48221
5
5
  SHA512:
6
- metadata.gz: '0078407305994e98a88a1bacc27a068da6fc84fb206de4f5315ec802d5a8802829aa73eecbe954d94d3e85cdc04b94c5622d8c1f0891754d304bbc43aebde484'
7
- data.tar.gz: 0bf901ecf33bd91b849e9e79571f618ef70ebcc0c66b5b53931d7112cbd3e2e78f8cb6d28f3fbbdbf54e33a6694eeb0dd67930e36679d3e0de8f56a5593226bf
6
+ metadata.gz: 6e3f554a6a434861cc05e461b6a7c9b9af265917f2fce21cc947fcf51d206de976fe8d7abe7f2684eaa075cc8f045d601535885dd0b64dbf61db7d9ae1552a8a
7
+ data.tar.gz: aa3c405230daa0c34902d42a4d6e3fabfeea3b7c6be4611a4535a5dbdcf57f1921e906da9397e7fc3c1d6e0ef60985ef3bc39e632c2f0f190ef703d93c54413e
@@ -54,14 +54,14 @@ 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.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
- @ideas = Idea.where("educode_sales_ideas.creator_id = ? OR educode_sales_ideas.id in (?)", @current_admin.id, idea_ids)
57
+ idea_ids = @ideas.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
+ @ideas = @ideas.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.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 }
64
+ idea_ids = @ideas.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
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
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '1.10.36'
2
+ VERSION = '1.10.37'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: educode_sales
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.36
4
+ version: 1.10.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460