blsm-vd-core 0.7.7 → 0.7.8
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/clearing_item.rb +7 -3
- data/lib/blsm-vd-core/model/order.rb +5 -0
- data/lib/blsm-vd-core/version.rb +1 -1
- data/lib/blsm-vd-core.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88eb769d8f1f8b766c331a5262a921eae496eca0
|
4
|
+
data.tar.gz: cd122a4b340b889ce0b461ebda72032d3d76f714
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 518848866205b77e4df608314fce2ebf0f83a77584e0a731a163977c4acb5f3a4d0022f8aee9101c9d69d032b94ed73b14b212a9aad5e8e63a23d92d6ec0e0f7
|
7
|
+
data.tar.gz: 6bde110e953670e59fb30f0340e4feb392d135d73005e985de5c14257053e7def01aee1c1132bb6848b8018518189acd8cda7803454f1666f45823522d6fd151
|
data/Gemfile.lock
CHANGED
@@ -27,8 +27,12 @@ module BlsmVdCore
|
|
27
27
|
update_params = {}
|
28
28
|
update_params[:notes] = note
|
29
29
|
update_params[:state] = 'CASH_BACK'
|
30
|
-
|
31
|
-
|
30
|
+
if self.order.toggle_delivery_deposit && self.order.pay_type.to_i==1
|
31
|
+
update_params[:real_amount] = self.order.payment_total.to_f+self.express_service_fee - (self.earn_amount - self.order_amount + self.order.real_shipping_charge * 2) - reduce_real_amount
|
32
|
+
else
|
33
|
+
update_params[:real_amount] = self.express_service_fee - (self.earn_amount - self.order_amount + self.order.real_shipping_charge * 2) - reduce_real_amount
|
34
|
+
end
|
35
|
+
|
32
36
|
update_params.delete(:real_amount) if self.possible_profit < 0.0
|
33
37
|
update_params[:rate_of_profit] = 1
|
34
38
|
self.update_attributes(update_params)
|
@@ -40,7 +44,7 @@ module BlsmVdCore
|
|
40
44
|
update_params[:notes] = note
|
41
45
|
update_params[:state] = 'CASH_BACK'
|
42
46
|
update_params[:earn_amount] = self.order.jm_profit
|
43
|
-
update_params[:real_amount] = self.order.actual_total
|
47
|
+
update_params[:real_amount] = ((self.order.toggle_delivery_deposit && self.order.pay_type.to_i==1) ? (self.order.actual_total.to_f+self.order.payment_total.to_f) : self.order.actual_total)
|
44
48
|
self.update_attributes(update_params)
|
45
49
|
end
|
46
50
|
end
|
data/lib/blsm-vd-core/version.rb
CHANGED
data/lib/blsm-vd-core.rb
CHANGED
@@ -88,9 +88,13 @@ module BlsmVdCore
|
|
88
88
|
VdRcMsgNotify.create_order_finish_notify(user.username)
|
89
89
|
end
|
90
90
|
# 给邀请人
|
91
|
-
inviter = User.where(:invication_code=>user.invicated_from).first
|
91
|
+
inviter = User.where(:invication_code=>user.invicated_from).first if user.invicated_from
|
92
92
|
vd_transaction = "inviter_#{order.id}_reward"
|
93
93
|
if user.create_vd_user_info.channel == "market_invite" && !inviter.blank? && !BlsmVdCore::VdInfoSec.dangerous?(vd_transaction)
|
94
|
+
|
95
|
+
#发送给邀请人微信提醒
|
96
|
+
content = "您邀请的店主 #{user.username}(注册电话号为#{user.phone})与#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}成功成交一笔订单,订单金额为#{order.total_fee.to_f}元, 您将同步获取邀请奖励#{(order.total_fee.to_f * 0.1).round(2)}元,特此通知"
|
97
|
+
|
94
98
|
#为邀请人创建,结算项
|
95
99
|
ClearingItem.create({
|
96
100
|
state: 'CASH_BACK',
|
@@ -100,8 +104,6 @@ module BlsmVdCore
|
|
100
104
|
rate_of_profit: 1,
|
101
105
|
earn_amount: (order.total_fee.to_f * 0.1).round(2)
|
102
106
|
})
|
103
|
-
#发送给邀请人微信提醒
|
104
|
-
content = "您邀请的店主 #{user.username}(注册电话号为#{user.phone})与#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}成功成交一笔订单,订单金额为#{order.total_fee.to_f}元, 您将同步获取邀请奖励#{(order.total_fee.to_f * 0.1).round(2)}元,特此通知"
|
105
107
|
VdMpMsg.create!({
|
106
108
|
app_id: BlsmMpWx.APP_ID,
|
107
109
|
openid: inviter.openid,
|
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.7.
|
4
|
+
version: 0.7.8
|
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-
|
12
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|