blsm-vd-core 0.5.6 → 0.5.7

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
  SHA1:
3
- metadata.gz: d93b32815a1471b035475ecace39277e994dd10e
4
- data.tar.gz: 853478c5acaec17e4e5da820ace1cd6ce96054c3
3
+ metadata.gz: a619cbb1c9137fb89506bd0c01b4589cacbe5e85
4
+ data.tar.gz: f5291a8daffd8237e733b7bc38eedb420951fcfa
5
5
  SHA512:
6
- metadata.gz: fc29ec990651c38491922c715be6413aa137046d5a0357070cc3eb349f73f936da78f39834396cc7b5a014d5347cb6c8c8ac8d620c55aabcf994aebfb1d4bb65
7
- data.tar.gz: f8ac65808f90982af3d9d3ae29dd83fe5d890c57f8114b1181b8549f91ddb37f6b8023bcc3e87b851139e001392836ba493126366daf609a580cebd760ff4765
6
+ metadata.gz: ce704d669799549cf738e93b7e01c86b2f8c9e6f561bfef3b22512b277e116ad660baa205ef23105f249eaefaca622095193f3cc2fba5aef1ba462cc014f5992
7
+ data.tar.gz: 26b418492e4c805a5e31cf21b97059040405a964a021bf07b87815f88263f52bb1201966afa8e2d8cc42020c6c8b3713011fbf5ceb448b1fcb9201e1f18daf05
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-vd-core (0.5.5)
4
+ blsm-vd-core (0.5.6)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
data/lib/blsm-vd-core.rb CHANGED
@@ -281,8 +281,8 @@ module BlsmVdCore
281
281
  end
282
282
 
283
283
  # 卖家信息变动
284
- # if seller_change!=0
285
- seller_info.update_attributes({:score => seller_info.score.to_f+seller_change}) if seller_change!=0
284
+ seller_info.change_score(seller_change) unless seller_change==0
285
+
286
286
  seller_notify = {touser: seller.openid, change: seller_change, total: seller_info.score, content: "您好,订单#{order.number}已成功签收,分销#{franchise_sum}元"}
287
287
  BlsmMpWx.create_msg(nil, seller.openid, seller_notify, 'score_change')
288
288
  VdUserScore.create({
@@ -295,7 +295,8 @@ module BlsmVdCore
295
295
 
296
296
  #黑带信息变动
297
297
  if leader && leader_info && leader_change && leader_change!=0
298
- leader_info.update_attributes({:score => leader_info.score.to_f+leader_change})
298
+
299
+ leader_info.change_score(leader_change)
299
300
  leader_notify = {touser: leader.openid, change: leader_change, total: leader_info.score, content: "首趣黑带#{leader.username},你好,你的队员【#{seller.username}】订单#{order.number}已成功签收,分销#{franchise_sum}元"}
300
301
  BlsmMpWx.create_msg(nil, leader.openid, leader_notify, 'score_change')
301
302
  VdUserScore.create({
@@ -308,7 +309,8 @@ module BlsmVdCore
308
309
 
309
310
  #原始黑带信息变动
310
311
  if org_leader && org_leader_info && org_leader_change && org_leader_change!=0
311
- org_leader_info.update_attributes({:score => org_leader_info.score.to_f+org_leader_change})
312
+ org_leader_info.change_score(org_leader_change)
313
+
312
314
  org_leader_notify = {touser: org_leader.openid, change: org_leader_change, total: org_leader_info.score,
313
315
  content: "首趣黑带#{org_leader.username},你好,你的附属黑带【#{leader.username}】的队员【#{seller.username}】订单#{order.number}已成功签收,分销#{franchise_sum}元"}
314
316
  BlsmMpWx.create_msg(nil, org_leader.openid, org_leader_notify, 'score_change')
@@ -320,8 +322,9 @@ module BlsmVdCore
320
322
  })
321
323
  end
322
324
  #店主销售额、分销额增加
323
- seller_info.update_attributes({:sale_sum => seller_info.sale_sum.to_f + order.total_fee.to_f})
324
- seller_info.update_attributes({:distribute_sum => seller_info.distribute_sum.to_f + order.franchise_sum.to_f})
325
+ VdUserInfo.update_counters(seller_info.id, :sale_sum => order.total_fee.to_f)
326
+ VdUserInfo.update_counters(seller_info.id, :distribute_sum => order.franchise_sum.to_f)
327
+ VdUserInfo.find_by_id(seller_info.id) { |info| info.sync_shop_state }
325
328
 
326
329
  #安全库录入信息
327
330
  VdInfoSec.committed(vd_transaction)
@@ -16,7 +16,7 @@ module BlsmVdCore
16
16
 
17
17
  #變化積分
18
18
  def change_score(changed_score)
19
- self.update_attributes({score: self.score+changed_score})
19
+ VdUserInfo.update_counters(self.id, score: changed_score)
20
20
  end
21
21
 
22
22
  #是否是黑带
@@ -1,3 +1,3 @@
1
1
  module BlsmVdCore
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
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.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-04-14 00:00:00.000000000 Z
12
+ date: 2016-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec