blsm-vd-core 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +6 -1
- data/blsm-vd-core.gemspec +1 -0
- data/lib/blsm-vd-core/version.rb +2 -2
- data/lib/blsm-vd-core.rb +14 -4
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODExNTc3ODI0YWUwMTJiMmJlNTg1YjFiMDFlZWFhNGFkNTg0ZmE3Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODAzYjY0YmE0ZDFjMDY5OWMxZmUzM2UzYTlkNjJlY2RiN2VmYTFhYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWM4NTk1MDQ4YTgyM2Q3MTVkZWZhM2Y1NTRiODMzYjE0ZDYxM2RjNGZjMjk4
|
10
|
+
OWUwYzQxYzUzYThiZjAzYWYxZTZjOWI3OTRkMDE1YzljMmYwNjI5OWUyOWY3
|
11
|
+
ZDAyMjQ4Y2EyNDllNDNlNmM2YmNmN2Q4MjBkODVlNzZlY2NlMzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmU3MTIwNmM5ZDhmODdlZWMwYjZkMTJkMzM0MTNlYmYxMTBiMWNkOGUyZjA1
|
14
|
+
MmM1NjhiMzgxOTE2NGRjMDIzOWYyY2FjN2ZhZjdlZWFiYTA5ZWEzMmUzYzU4
|
15
|
+
OGNkNDRlNTRlYmVjY2UwOWMxM2RjMjMzNjM3MGQ4MjVlYmI4NjY=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
blsm-vd-core (0.2.
|
4
|
+
blsm-vd-core (0.2.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://ruby.taobao.org/
|
@@ -34,6 +34,7 @@ GEM
|
|
34
34
|
i18n (~> 0.6)
|
35
35
|
multi_json (~> 1.0)
|
36
36
|
arel (3.0.2)
|
37
|
+
blsm-mp-wx (0.1.7)
|
37
38
|
builder (3.0.0)
|
38
39
|
diff-lcs (1.2.5)
|
39
40
|
erubis (2.7.0)
|
@@ -108,6 +109,7 @@ DEPENDENCIES
|
|
108
109
|
activemodel (~> 3.2)
|
109
110
|
activerecord (~> 3.2)
|
110
111
|
activesupport (~> 3.2)
|
112
|
+
blsm-mp-wx (~> 0.1.7)
|
111
113
|
blsm-vd-core!
|
112
114
|
bundler (~> 1.9)
|
113
115
|
faraday (~> 0.9)
|
@@ -115,3 +117,6 @@ DEPENDENCIES
|
|
115
117
|
rails (~> 3.2)
|
116
118
|
rake (~> 10.0)
|
117
119
|
rspec (~> 3.2)
|
120
|
+
|
121
|
+
BUNDLED WITH
|
122
|
+
1.10.3
|
data/blsm-vd-core.gemspec
CHANGED
@@ -37,4 +37,5 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency "activerecord", "~> 3.2"
|
38
38
|
spec.add_development_dependency "activesupport", "~> 3.2"
|
39
39
|
spec.add_development_dependency "faraday", "~> 0.9"
|
40
|
+
spec.add_development_dependency "blsm-mp-wx", "~> 0.1.7"
|
40
41
|
end
|
data/lib/blsm-vd-core/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module BlsmVdCore
|
2
|
-
VERSION = "0.2.
|
3
|
-
end
|
2
|
+
VERSION = "0.2.3"
|
3
|
+
end
|
data/lib/blsm-vd-core.rb
CHANGED
@@ -18,6 +18,7 @@ require 'blsm-vd-core/model/vd_info_sec'
|
|
18
18
|
require 'blsm-vd-core/model/user'
|
19
19
|
require 'blsm-vd-core/model/application'
|
20
20
|
require 'faraday'
|
21
|
+
require 'blsm-mp-wx'
|
21
22
|
|
22
23
|
module BlsmVdCore
|
23
24
|
|
@@ -219,18 +220,27 @@ module BlsmVdCore
|
|
219
220
|
franchise_sum = order.franchise_sum
|
220
221
|
|
221
222
|
#积分获取
|
222
|
-
|
223
|
-
|
223
|
+
seller_change = franchise_sum.to_f*VdUserScore::SCORES[:SALE_OUT_DIRECT]
|
224
|
+
leader_change = franchise_sum.to_f*VdUserScore::SCORES[:SALE_OUT_INDIRECT]
|
225
|
+
seller_info.update_attributes({:score => seller_info.score.to_f+seller_change})
|
226
|
+
leader_info.update_attributes({:score => leader_info.score.to_f+leader_change}) if leader_info
|
227
|
+
|
228
|
+
#积分变动通知
|
229
|
+
seller_notify = {touser: seller.openid, change: seller_change, total: seller_info.score, content: "分销#{franchise_sum}元,订单#{order_id}完成"}
|
230
|
+
leader_notify = {touser: leader.openid, change: leader_change, total: leader_info.score, content: "成员【#{seller.username}】分销#{franchise_sum}元,订单#{order_id}完成"} if leader && leader_info
|
231
|
+
BlsmMpWx.create_msg(nil, seller.openid, seller_notify, 'score_change')
|
232
|
+
BlsmMpWx.create_msg(nil, leader.openid, leader_notify, 'score_change') if leader_notify
|
233
|
+
|
224
234
|
|
225
235
|
#积分历史
|
226
236
|
VdUserScore.create({
|
227
237
|
user_id: seller_id,
|
228
|
-
score:
|
238
|
+
score: seller_change,
|
229
239
|
notes: "分销#{franchise_sum}元,订单#{order_id}完成"
|
230
240
|
})
|
231
241
|
VdUserScore.create({
|
232
242
|
user_id: leader.id,
|
233
|
-
score:
|
243
|
+
score: leader_change,
|
234
244
|
notes: "成员【#{seller.username}】分销#{franchise_sum}元,订单#{order_id}完成"
|
235
245
|
}) if leader_info
|
236
246
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blsm-vd-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saxer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ~>
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0.9'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: blsm-mp-wx
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ~>
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.1.7
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ~>
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.1.7
|
139
153
|
description: 首趣微店核心模块,包含结算项的创建、更新、删除,微店主积分的更改等信息
|
140
154
|
email:
|
141
155
|
- 15201280641@qq.com
|