educode_sales 0.9.29 → 0.9.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/educode_sales/businesses_controller.rb +2 -2
- data/app/controllers/educode_sales/sale_trends_controller.rb +9 -7
- data/app/models/educode_sales/business.rb +1 -1
- data/app/views/educode_sales/businesses/index.json.jbuilder +1 -1
- data/app/views/educode_sales/sale_trends/_business_followup_analysis.html.erb +3 -2
- data/lib/educode_sales/version.rb +1 -1
- metadata +6 -7
- data/app/assets/images/educode_sales/indexlogo.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51800df7e8c3e444188f0353c66757741c5a99e710426b47da2e9593c65f819f
|
4
|
+
data.tar.gz: 89735f6378821ee46fc806198a24559015440a0047ee6fc4ca27f8d364b69755
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f967ae4f53c7819b02f3f006a9309434b41b5d22474504464b6e22f3a5469c810a24e221e82468b642240dd81e320b019cd45f0a018e9d94fda99fa646245c5
|
7
|
+
data.tar.gz: 65c325fc5d46fcfdb7ec964881ab0fb832857d428a10241fced792709871c9092ce907c5f74cc23581e2f8776a972a7f3f32d17343a2d377a4b2597610d4f65c
|
@@ -264,11 +264,11 @@ module EducodeSales
|
|
264
264
|
(last_follow.total_amount - last_follow.actual_amount) as divide_money,
|
265
265
|
(last_follow.actual_amount - educode_sales_businesses.return_money) as wait_return_money,
|
266
266
|
last_follow.total_amount,
|
267
|
-
total_follow_ups.
|
267
|
+
total_follow_ups.follow_ups_counts
|
268
268
|
").joins("
|
269
269
|
LEFT JOIN educode_sales_follow_ups AS last_follow ON educode_sales_businesses.last_follow_up_id = last_follow.id AND last_follow.deleted_at IS NULL
|
270
270
|
LEFT JOIN (
|
271
|
-
SELECT COUNT(*) AS
|
271
|
+
SELECT COUNT(*) AS follow_ups_counts, educode_sales_follow_ups.business_id
|
272
272
|
FROM educode_sales_follow_ups
|
273
273
|
WHERE educode_sales_follow_ups.deleted_at IS NULL
|
274
274
|
GROUP BY educode_sales_follow_ups.business_id
|
@@ -117,7 +117,8 @@ module EducodeSales
|
|
117
117
|
when "week" #按周
|
118
118
|
if params[:date_week].present?
|
119
119
|
date = params[:date_week].split(" - ")
|
120
|
-
|
120
|
+
# 年初第一天周数是0会导致周数重复计算
|
121
|
+
dates = (date[0].to_date..date[1].to_date).map { |d| d.strftime("%Y-%W") }.uniq.select { |d| d.split("-")[1] != '00' }
|
121
122
|
@follow_count_data = business_followup_charts(dates, names, x_business_ids, SaleTrend::COLORS, date, "%Y%u") do |dates|
|
122
123
|
dates.map { |date|
|
123
124
|
d = date.split("-")
|
@@ -190,6 +191,9 @@ module EducodeSales
|
|
190
191
|
when "month" #按月
|
191
192
|
if params[:goal_date_month].present?
|
192
193
|
date = params[:goal_date_month].split(" - ")
|
194
|
+
date[0] = (date[0] + "-01").to_date.to_s
|
195
|
+
date[1] = (date[1] + "-01").to_date.end_of_month.to_s
|
196
|
+
|
193
197
|
dates = ((date[0] + "-01").to_date..(date[1] + "-01").to_date).map { |d| d.strftime("%Y-%m") }.uniq
|
194
198
|
@goal_count_data = month_sale_chart(dates, sale_names, SaleTrend::COLORS, x, stage_ids, s_stage_ids, count_type, date)
|
195
199
|
else
|
@@ -414,11 +418,9 @@ module EducodeSales
|
|
414
418
|
|
415
419
|
|
416
420
|
def month_sale_chart(dates, names, colors, x, stage_ids, s_stage_ids, count_type, range)
|
417
|
-
begin_at = range[0]
|
418
|
-
end_at = range[1]
|
421
|
+
begin_at = range[0]
|
422
|
+
end_at = range[1]
|
419
423
|
|
420
|
-
begin_at = DateTime.new begin_at[0].to_i, begin_at[1].to_i
|
421
|
-
end_at = DateTime.new end_at[0].to_i, end_at[1].to_i
|
422
424
|
data_1 = EducodeSales::Business.joins(:last_follow_up).
|
423
425
|
where("educode_sales_follow_ups.clazz_id != ?", x).
|
424
426
|
where("educode_sales_follow_ups.stage_id IN (?)", stage_ids).
|
@@ -531,8 +533,8 @@ module EducodeSales
|
|
531
533
|
def year_sale_chart(dates, names, colors, x, stage_ids, s_stage_ids, count_type, range)
|
532
534
|
begin_at = range[0].split("-")
|
533
535
|
end_at = range[1].split("-")
|
534
|
-
begin_at = DateTime.new(begin_at[0].to_i).beginning_of_year
|
535
|
-
end_at = DateTime.new(end_at[0].to_i).end_of_year
|
536
|
+
begin_at = DateTime.new(begin_at[0].to_i).beginning_of_year.to_date.to_s
|
537
|
+
end_at = DateTime.new(end_at[0].to_i).end_of_year.to_date.to_s
|
536
538
|
|
537
539
|
data_1 = EducodeSales::Business.joins(:last_follow_up).
|
538
540
|
where("educode_sales_follow_ups.clazz_id != ?", x).
|
@@ -8,7 +8,7 @@ json.data do
|
|
8
8
|
json.department d.department.name
|
9
9
|
json.school d.department.school.name
|
10
10
|
json.school_id d.department.school.id
|
11
|
-
follow_ups_count = d['
|
11
|
+
follow_ups_count = d['follow_ups_counts'] || 0
|
12
12
|
json.follow_ups_count follow_ups_count
|
13
13
|
follow_count += follow_ups_count
|
14
14
|
json.follow_up_id d.last_follow_up_id
|
@@ -54,11 +54,11 @@
|
|
54
54
|
function renderTable(chart_data) {
|
55
55
|
var labels = [];
|
56
56
|
fields = [
|
57
|
-
{field: 'col0', title: '姓名', width:100}
|
57
|
+
{field: 'col0', title: '姓名', width:100, totalRowText: '合计:'}
|
58
58
|
];
|
59
59
|
chart_data.labels.forEach(function(d, i) {
|
60
60
|
labels.push(d);
|
61
|
-
fields.push({title: d.split("(").join("<br/>").replace(")", ""), field: 'col' + (i + 1), width:
|
61
|
+
fields.push({title: d.split("(").join("<br/>").replace(")", ""), field: 'col' + (i + 1), width:180, align: 'center', sort: true, totalRow: '{{ parseInt(d.TOTAL_NUMS) }}'})
|
62
62
|
})
|
63
63
|
var table_data = [];
|
64
64
|
chart_data.datasets.forEach(function(d, i) {
|
@@ -78,6 +78,7 @@
|
|
78
78
|
url: '',
|
79
79
|
limit: 1000,
|
80
80
|
page: false,
|
81
|
+
totalRow: true,
|
81
82
|
data: table_data,
|
82
83
|
cols: [fields]
|
83
84
|
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: educode_sales
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anke1460
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -105,7 +105,6 @@ files:
|
|
105
105
|
- app/assets/images/educode_sales/icon-login.png
|
106
106
|
- app/assets/images/educode_sales/icon.png
|
107
107
|
- app/assets/images/educode_sales/indexLogo.png
|
108
|
-
- app/assets/images/educode_sales/indexlogo.png
|
109
108
|
- app/assets/images/educode_sales/loading-0.gif
|
110
109
|
- app/assets/images/educode_sales/loading-1.gif
|
111
110
|
- app/assets/images/educode_sales/loading-2.gif
|
@@ -491,7 +490,7 @@ homepage: https://www.educoder.net
|
|
491
490
|
licenses:
|
492
491
|
- MIT
|
493
492
|
metadata: {}
|
494
|
-
post_install_message:
|
493
|
+
post_install_message:
|
495
494
|
rdoc_options: []
|
496
495
|
require_paths:
|
497
496
|
- lib
|
@@ -506,8 +505,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
506
505
|
- !ruby/object:Gem::Version
|
507
506
|
version: '0'
|
508
507
|
requirements: []
|
509
|
-
rubygems_version: 3.0.
|
510
|
-
signing_key:
|
508
|
+
rubygems_version: 3.0.0
|
509
|
+
signing_key:
|
511
510
|
specification_version: 4
|
512
511
|
summary: Summary of EducodeSales.
|
513
512
|
test_files: []
|
Binary file
|