blsm-vd-core 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/blsm-vd-core/model/vd_user_info.rb +23 -2
- data/lib/blsm-vd-core/model/vd_wx_pay.rb +7 -0
- data/lib/blsm-vd-core/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13344336d0479a112cfaa02f8805d282a88905c2
|
4
|
+
data.tar.gz: 17c2fb659700b6a1071b106f6071af4a91fadf83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b4b5be8c3f3d4101cac229bd5c1fd531df9344082cb39b8de80da990244d238ca9947ea53f5e9ea77aa2bee5d257294ac50c4d5fc837499ca6f8dcf4b033b7a
|
7
|
+
data.tar.gz: 8126fd350b189ef278b1662a7c62a401791252f439fdd5bab18ae883a3d3bfaaa187b625f83a54b867bdcdc7f3782d41184c382b8f8de51fc1c36e3ff64cca17
|
data/Gemfile.lock
CHANGED
@@ -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
|
22
|
-
return 0.
|
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
|
|
data/lib/blsm-vd-core/version.rb
CHANGED
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.
|
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:
|
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:
|