blsm-vd-core 0.4.8 → 0.4.9

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: c2e4c393f9c216eaed675b271630dc4e3c510083
4
- data.tar.gz: 102b4dbcb46114b6752f3f27bf2e5d201e049fb9
3
+ metadata.gz: 2d2f147d142fcdbb81884b49b41f7b5b6e22b332
4
+ data.tar.gz: 9273037e4c488ee026ce56ae98a7c96701712b16
5
5
  SHA512:
6
- metadata.gz: df32d33db6fdae4dd501e0581285349da4b53f6c63b04e01d7a8acf24f5214c4fc690ed34f9333c242d2107307782142ab5a7b30ff5450a2406bb95da3ef8281
7
- data.tar.gz: e0f73430145cc0ed6854552a3ed1276bc14393d5f73968775b8d7084433e5212d1f2f6425e914e8b574db9db40a166ae49df95b2b986aaedf2c32626b8332f19
6
+ metadata.gz: c5a3a48e786102f09866f13a883fd862f2a0b38fdcc1a51cd6884102dbd1ace22238b7945738caf8ad09b8744d56565f517d743b33ef006a22408cee69d651e5
7
+ data.tar.gz: fd8a15b07f0d653343a7a5936332d4a4b36251702cac6acb3b57ca970598c20eca9ce1a60dfdeb9f0ae615f9bb545a50c10844fa1fe8834c6e0b111e1692ded6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-vd-core (0.4.7)
4
+ blsm-vd-core (0.4.8)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
@@ -36,6 +36,7 @@ GEM
36
36
  arel (3.0.2)
37
37
  blsm-mp-wx (0.2.3)
38
38
  builder (3.0.0)
39
+ coderay (1.1.0)
39
40
  diff-lcs (1.2.5)
40
41
  erubis (2.7.0)
41
42
  faraday (0.9.1)
@@ -48,11 +49,16 @@ GEM
48
49
  i18n (>= 0.4.0)
49
50
  mime-types (~> 1.16)
50
51
  treetop (~> 1.4.8)
52
+ method_source (0.8.2)
51
53
  mime-types (1.19)
52
54
  multi_json (1.11.0)
53
55
  multipart-post (2.0.0)
54
56
  mysql2 (0.3.17)
55
57
  polyglot (0.3.3)
58
+ pry (0.10.1)
59
+ coderay (~> 1.1.0)
60
+ method_source (~> 0.8.1)
61
+ slop (~> 3.4)
56
62
  rack (1.4.1)
57
63
  rack-cache (1.2)
58
64
  rack (>= 0.4)
@@ -91,6 +97,7 @@ GEM
91
97
  diff-lcs (>= 1.2.0, < 2.0)
92
98
  rspec-support (~> 3.2.0)
93
99
  rspec-support (3.2.2)
100
+ slop (3.6.0)
94
101
  sprockets (2.1.3)
95
102
  hike (~> 1.2)
96
103
  rack (~> 1.0)
@@ -114,6 +121,7 @@ DEPENDENCIES
114
121
  bundler (~> 1.9)
115
122
  faraday (~> 0.9)
116
123
  mysql2 (~> 0.3.16)
124
+ pry
117
125
  rails (~> 3.2)
118
126
  rake (~> 10.0)
119
127
  rspec (~> 3.2)
data/blsm-vd-core.gemspec CHANGED
@@ -38,4 +38,5 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency "activesupport", "~> 3.2"
39
39
  spec.add_development_dependency "faraday", "~> 0.9"
40
40
  spec.add_development_dependency "blsm-mp-wx", "~> 0.2.3"
41
+ spec.add_development_dependency "pry"
41
42
  end
@@ -3,6 +3,7 @@ module BlsmVdCore
3
3
  class User < BlsmVdCore::BaseRecord
4
4
  self.table_name='users'
5
5
  has_many :clearing_items, class_name: "::BlsmVdCore::LineItem"
6
+ has_many :applications, class_name: "::BlsmVdCore::Application"
6
7
  has_many :clearings, class_name: "::BlsmVdCore::Clearing"
7
8
  has_one :vd_user_info, class_name: "::BlsmVdCore::VdUserInfo"
8
9
 
@@ -6,6 +6,8 @@ module BlsmVdCore
6
6
  belongs_to :user, class_name: '::BlsmVdCore::User'
7
7
  belongs_to :supervisor, class_name: '::BlsmVdCore::User'
8
8
 
9
+ after_save :sync_shop_state #同步用户拥有的店铺的状态
10
+
9
11
  LEVELS = {
10
12
  1 => '普通店主',
11
13
  2 => '金牌店主',
@@ -44,5 +46,12 @@ module BlsmVdCore
44
46
  1
45
47
  end
46
48
 
49
+ def sync_shop_state
50
+ if level >2 && self.user
51
+ self.user.applications.each do |shop|
52
+ shop.update_attributes({support_hdfk: true})
53
+ end
54
+ end
55
+ end
47
56
  end
48
57
  end
@@ -1,3 +1,3 @@
1
1
  module BlsmVdCore
2
- VERSION = "0.4.8"
2
+ VERSION = "0.4.9"
3
3
  end
data/lib/blsm-vd-core.rb CHANGED
@@ -379,33 +379,6 @@ module BlsmVdCore
379
379
  end
380
380
  end
381
381
 
382
- # leader_order_score = VdUserScore.where(user_id: leader.id).where(score_type: score_type_str).first if leader && leader_info
383
- # seller_change = -VdUserScore.where(user_id: seller.id).where(score_type: score_type_str).first.score
384
- # leader_change = -leader_order_score.score if leader_order_score
385
- #
386
- # #扣取积分
387
- # seller_info.change_score(seller_change)
388
- # leader_info.change_score(leader_change) if leader_change
389
- #
390
- # #积分变动通知
391
- # seller_notify = {touser: seller.openid, change: seller_change, total: seller_info.score, content: "订单#{order_id}取消"}
392
- # leader_notify = {touser: leader.openid, change: leader_change, total: leader_info.score, content: "成员【#{seller.username}】订单#{order_id}取消,积分扣取"} if leader_order_score
393
- # BlsmMpWx.create_msg(nil, seller.openid, seller_notify, 'score_change')
394
- # BlsmMpWx.create_msg(nil, leader.openid, leader_notify, 'score_change') if leader_notify
395
- #
396
- # #积分历史
397
- # VdUserScore.create({
398
- # user_id: seller_id,
399
- # score: seller_change,
400
- # notes: "订单#{order_id}取消,积分扣取",
401
- # score_type: vd_transaction
402
- # })
403
- # VdUserScore.create({
404
- # user_id: leader.id,
405
- # score: leader_change,
406
- # notes: "成员【#{seller.username}】订单#{order_id}取消,积分扣取",
407
- # score_type: vd_transaction
408
- # }) if leader_order_score
409
382
 
410
383
  #安全库录入信息
411
384
  VdInfoSec.committed(vd_transaction)
@@ -450,40 +423,6 @@ module BlsmVdCore
450
423
  end
451
424
  end
452
425
 
453
- #卖家和团队领导的信息
454
- # seller_info = seller.create_vd_user_info
455
- # leader_info = leader && leader.is_vd_black? ? leader.create_vd_user_info : nil
456
- #
457
- # #供货价总和、应该扣取的积分总额
458
- # franchise_sum = order.franchise_sum
459
- # leader_order_score = VdUserScore.where(user_id: leader.id).where(score_type: score_type_str).first if leader && leader_info
460
- # seller_change = -VdUserScore.where(user_id: seller.id).where(score_type: score_type_str).first.score
461
- # leader_change = -leader_order_score.score if leader_order_score
462
- #
463
- # #扣取积分
464
- # seller_info.change_score(seller_change)
465
- # leader_info.change_score(leader_change) if leader_change
466
- #
467
- # #积分变动通知
468
- # seller_notify = {touser: seller.openid, change: seller_change, total: seller_info.score, content: "订单#{order_id}拒签"}
469
- # leader_notify = {touser: leader.openid, change: leader_change, total: leader_info.score, content: "成员【#{seller.username}】订单#{order_id}拒签,积分扣取"} if leader_order_score
470
- # BlsmMpWx.create_msg(nil, seller.openid, seller_notify, 'score_change')
471
- # BlsmMpWx.create_msg(nil, leader.openid, leader_notify, 'score_change') if leader_notify
472
- #
473
- # #积分历史
474
- # VdUserScore.create({
475
- # user_id: seller_id,
476
- # score: seller_change,
477
- # notes: "订单#{order_id}拒签,积分扣取",
478
- # score_type: vd_transaction
479
- # })
480
- # VdUserScore.create({
481
- # user_id: leader.id,
482
- # score: leader_change,
483
- # notes: "成员【#{seller.username}】订单#{order_id}拒签,积分扣取",
484
- # score_type: vd_transaction
485
- # }) if leader_order_score
486
-
487
426
  #安全库录入信息
488
427
  VdInfoSec.committed(vd_transaction)
489
428
 
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.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
@@ -151,6 +151,20 @@ dependencies:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
153
  version: 0.2.3
154
+ - !ruby/object:Gem::Dependency
155
+ name: pry
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
154
168
  description: 首趣微店核心模块,包含结算项的创建、更新、删除,微店主积分的更改等信息
155
169
  email:
156
170
  - 15201280641@qq.com