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: 733d10f3f04531daa5d9aed3a9a9d8d34e41c74ca57ce61b817360147b914d61
4
- data.tar.gz: 80527d327ad6f4cee282df6608140f1df12edac667b9882559d52e405ad0f14c
3
+ metadata.gz: 202bd95e90b6448156fe54662adb177661b35bfe393c8bfd55b2c7ea1b9b969f
4
+ data.tar.gz: 8bfdc6c034e250245520c6979ca16b2250910088c6b1a8271c78dc83f5db27d3
5
5
  SHA512:
6
- metadata.gz: 82c1b9e3da991893900a0b5b28ff034ee6b818128f491fe3c9eb8b3b26025cdd283ce365c5ec5f495340d4fef314e78167941c6f89ced2533b0e6f08e7dd6f75
7
- data.tar.gz: e710d633ca97617cb7c946d56c071f16d8339d208e851ef24b2a905c3d027aabf7dfbd38d1158793eadca1286af25fee759bc128e0e8de2b542de9649cd5bfa6
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.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 }
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.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 = 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
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '1.10.35'
2
+ VERSION = '1.10.36'
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.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460