educode_sales 1.10.35 → 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: 733d10f3f04531daa5d9aed3a9a9d8d34e41c74ca57ce61b817360147b914d61
4
- data.tar.gz: 80527d327ad6f4cee282df6608140f1df12edac667b9882559d52e405ad0f14c
3
+ metadata.gz: b46b08f02fd4495dc7dcbe644409b09c38fd9936ce81c574d8747eadeb935dab
4
+ data.tar.gz: 874c54125a516d0631812e60fb439418cf050550dfd40166777762d4e6b48221
5
5
  SHA512:
6
- metadata.gz: 82c1b9e3da991893900a0b5b28ff034ee6b818128f491fe3c9eb8b3b26025cdd283ce365c5ec5f495340d4fef314e78167941c6f89ced2533b0e6f08e7dd6f75
7
- data.tar.gz: e710d633ca97617cb7c946d56c071f16d8339d208e851ef24b2a905c3d027aabf7dfbd38d1158793eadca1286af25fee759bc128e0e8de2b542de9649cd5bfa6
6
+ metadata.gz: 6e3f554a6a434861cc05e461b6a7c9b9af265917f2fce21cc947fcf51d206de976fe8d7abe7f2684eaa075cc8f045d601535885dd0b64dbf61db7d9ae1552a8a
7
+ data.tar.gz: aa3c405230daa0c34902d42a4d6e3fabfeea3b7c6be4611a4535a5dbdcf57f1921e906da9397e7fc3c1d6e0ef60985ef3bc39e632c2f0f190ef703d93c54413e
@@ -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.all.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.all.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.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)
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
+ @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
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '1.10.35'
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.35
4
+ version: 1.10.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460