blsm-vd-core 0.4.5 → 0.4.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b244c6be1d637b092eda8d78d28fc281de11de2
4
- data.tar.gz: 2068c352a48048c956360c226a904b9a476b8a30
3
+ metadata.gz: 13344336d0479a112cfaa02f8805d282a88905c2
4
+ data.tar.gz: 17c2fb659700b6a1071b106f6071af4a91fadf83
5
5
  SHA512:
6
- metadata.gz: 2af23a1b25bc42921546232427f0c51d6da1fb7a5a7fdf16d63dcc8f104ac3b557e3f69a2a18c9c4462dde999afdb048553cca018fa0e447f9d08adbb08a7ebf
7
- data.tar.gz: 2f7343108c0d48dc69d6cf96ea4bf0ed637f370f5c5a565973ff6b46135e8dd73c6c6d5c4718a5cb3d4bedc9498265625ce9d38c5519e9a3e5a0cdb9b93efe1a
6
+ metadata.gz: 3b4b5be8c3f3d4101cac229bd5c1fd531df9344082cb39b8de80da990244d238ca9947ea53f5e9ea77aa2bee5d257294ac50c4d5fc837499ca6f8dcf4b033b7a
7
+ data.tar.gz: 8126fd350b189ef278b1662a7c62a401791252f439fdd5bab18ae883a3d3bfaaa187b625f83a54b867bdcdc7f3782d41184c382b8f8de51fc1c36e3ff64cca17
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-vd-core (0.4.4)
4
+ blsm-vd-core (0.4.5)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
@@ -6,6 +6,12 @@ module BlsmVdCore
6
6
  belongs_to :user, class_name: '::BlsmVdCore::User'
7
7
  belongs_to :supervisor, class_name: '::BlsmVdCore::User'
8
8
 
9
+ LEVELS = {
10
+ 1 => '普通店主',
11
+ 2 => '金牌店主',
12
+ 3 => '钻石店主'
13
+ }
14
+
9
15
  #變化積分
10
16
  def change_score(changed_score)
11
17
  self.update_attributes({score: self.score+changed_score})
@@ -16,10 +22,25 @@ module BlsmVdCore
16
22
  self.vd_role == 'black'
17
23
  end
18
24
 
25
+ #店主等级
26
+ def level
27
+ return 3 if self.distribute_sum.to_f>=5000
28
+ return 2 if self.distribute_sum.to_f>=1500
29
+
30
+ golden_pay = VdWxPay.where(user_id: self.user_id,
31
+ return_code: 'SUCCESS',
32
+ result_code: 'SUCCESS',
33
+ vd_service_id: 1
34
+ ).first
35
+ return 2 if golden_pay
36
+ 1
37
+ end
38
+
19
39
  #利润率,跟销售额有关系
20
40
  def profit_rate
21
- return 0.5 if self.sale_sum.to_f<1500
22
- return 0.7 if self.sale_sum.to_f<3000
41
+ return 1 if level>=2
42
+ return 0.5 if self.distribute_sum.to_f<750
43
+ return 0.7 if self.distribute_sum.to_f<1500
23
44
  1
24
45
  end
25
46
 
@@ -0,0 +1,7 @@
1
+ # coding: utf-8
2
+ module BlsmVdCore
3
+ class VdWxPay < BlsmVdCore::BaseRecord
4
+ self.table_name = 'vd_wx_pays'
5
+ belongs_to :user, class_name: '::BlsmVdCore::User'
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module BlsmVdCore
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
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.4.5
4
+ version: 0.4.6
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: 2015-11-27 00:00:00.000000000 Z
12
+ date: 2016-01-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -182,6 +182,7 @@ files:
182
182
  - lib/blsm-vd-core/model/vd_info_sec.rb
183
183
  - lib/blsm-vd-core/model/vd_user_info.rb
184
184
  - lib/blsm-vd-core/model/vd_user_score.rb
185
+ - lib/blsm-vd-core/model/vd_wx_pay.rb
185
186
  - lib/blsm-vd-core/version.rb
186
187
  homepage: https://bitbucket.org/Xiaopuzhu/blsm-vd-core
187
188
  licenses: