blsm-vd-core 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDY0OGFiZTI1ZWQyNjE1OWU3MzhlMWFlYzc2N2Q4OGM4ZWEyNmNhMQ==
4
+ MWVhZTNmZTdmOWIyYzk1MjAzZmYwNmFmNTI1YTgxODM4NzYwNmE2Yw==
5
5
  data.tar.gz: !binary |-
6
- NDhhODgzMzM4MjEzOTgyOWRlNDM3NWQyNzY0NzkxMTEyMDhhZmJjOQ==
6
+ NTMwMGM4NTY5ZTExNTFjNDExOGFlYWU1YTg0ZmIxNGZiMGVhMTEzOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzU2ZTFlMjJjODRmZjAxOThjOTg1NGVhY2Y0MzdiYTZjNmFiNjBjMzJjYmI3
10
- Mjg0YmRhNTg5YTcxZTdiMGNhNTU3MWY3NTM2Y2M2MWM2MzllZjJkNWNjZGQx
11
- YWJiNjE0ZTllMzE5NmE0YmM4ZmRiMjE5MWY4NWZhNmZjOTEwNWE=
9
+ OTAwOTUxOWY5MjJlMDBiNmE1MzU3OTI2NmUwYjBhZjYxMWFkYWVhMzc3NDI0
10
+ YzEzYTAxMmFkMTBjODZkYmY5ZTU1NjZiZTdhMGM4NTMyZTQ2YWRiOWE2OWJl
11
+ MGJjMTcxNzQ1N2FjZjIyN2YxNTVmYjkzNGE0MWVhYjk3NGMxODE=
12
12
  data.tar.gz: !binary |-
13
- NWVhOGQ4NjMyNjU4N2Q0MzczYTY3Y2QzMmI3ZmNlODU0MzllMjUyZDk1N2Y5
14
- OTM0ODVjYjU3YjliMTUwYWRhYjNjMmMwNDljZTQwOTFmOWE2MjBkMGNkMWYx
15
- NDQ0MDMzMzY3YThhNjc5MmE4ZGM5ZjA2ZDdlZThhMmYzZDMzNmU=
13
+ MjQ4NTkyNjk0MzlhZmEwZDY3M2ExOGEwODkzZWFhNzUzMzgzOTUyZThhNWJl
14
+ OTg0YTg1OGVhY2MxZGM5NzU1NWRlMDVjYWE1NGYxNmUwNGMxYzJmMjQxYjc1
15
+ MTg2ZDE1NTdkNzQxNTA3MGEzYmNmNjE3ZDQ5ODE4OGZhOGVjMzQ=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-vd-core (0.3.1)
4
+ blsm-vd-core (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
@@ -1,3 +1,3 @@
1
1
  module BlsmVdCore
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
data/lib/blsm-vd-core.rb CHANGED
@@ -162,7 +162,23 @@ module BlsmVdCore
162
162
  data[:state] = 'CASH_BACK'
163
163
  data[:real_amount] = order.total_fee
164
164
  end
165
+
165
166
  ClearingItem.new(data).save
167
+
168
+
169
+ leader = User.where("id in(select supervisor_id from vd_user_infos where user_id=#{user.id})").first
170
+ leader_info = leader.create_vd_user_info if leader
171
+
172
+ #订单确认提醒(黑带)
173
+ leader_change = order.franchise_sum.to_f*VdUserScore::SCORES[:SALE_OUT_INDIRECT]
174
+ distribute_leader_notify = {touser: leader.openid,
175
+ order_id: Order.encrypt(Order.encrypted_id_key, order.id.to_s),
176
+ score_change: leader_change,
177
+ money_change: leader_change*VdUserScore::SCORES[:SCORE_TO_MONEY],
178
+ content: "首趣黑带#{leader.username},你好:成员【#{user.username}】确认订单成功。"
179
+ } if leader && leader_info
180
+ BlsmMpWx.create_msg(nil, leader.openid, distribute_leader_notify, 'distribute') if distribute_leader_notify
181
+
166
182
  return ERROR_CODES[200]
167
183
  end
168
184
  end
@@ -230,15 +246,6 @@ module BlsmVdCore
230
246
  BlsmMpWx.create_msg(nil, seller.openid, seller_notify, 'score_change')
231
247
  BlsmMpWx.create_msg(nil, leader.openid, leader_notify, 'score_change') if leader_notify
232
248
 
233
- #订单确认提醒(黑带)
234
- distribute_leader_notify = {touser: leader.openid,
235
- order_id: Order.encrypt(Order.encrypted_id_key, order.id.to_s),
236
- score_change: leader_change,
237
- money_change: leader_change*VdUserScore::SCORES[:SCORE_TO_MONEY],
238
- content: "首趣黑带#{leader.username},你好:成员【#{seller.username}】确认订单成功。"
239
- } if leader && leader_info
240
- BlsmMpWx.create_msg(nil, leader.openid, distribute_leader_notify, 'distribute') if distribute_leader_notify
241
-
242
249
  #积分历史
243
250
  VdUserScore.create({
244
251
  user_id: seller_id,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blsm-vd-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer