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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5cfbe74a9b2aae00ab57d96ad09e061fbd97b5b7
4
- data.tar.gz: f12f5e6d61cbb865c8770740870e2d61af15c47d
3
+ metadata.gz: 88eb769d8f1f8b766c331a5262a921eae496eca0
4
+ data.tar.gz: cd122a4b340b889ce0b461ebda72032d3d76f714
5
5
  SHA512:
6
- metadata.gz: a38942e555d4a3570a076a70b75fa20c7153285d3c0587c3d2f15b231aa3574c0a4dc6bd97da69c30f614040d5bd778f989bda3c9395037e9e34d90c1dd27a05
7
- data.tar.gz: f98d6419af754ff7c6a4ea759d511955b1e826724e929951965b6695f8f9a120abb041eec43baa6c2464c7be1cca83934a9d30b93faba6f46bd710beea337860
6
+ metadata.gz: 518848866205b77e4df608314fce2ebf0f83a77584e0a731a163977c4acb5f3a4d0022f8aee9101c9d69d032b94ed73b14b212a9aad5e8e63a23d92d6ec0e0f7
7
+ data.tar.gz: 6bde110e953670e59fb30f0340e4feb392d135d73005e985de5c14257053e7def01aee1c1132bb6848b8018518189acd8cda7803454f1666f45823522d6fd151
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-vd-core (0.7.7)
4
+ blsm-vd-core (0.7.8)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
@@ -27,8 +27,12 @@ module BlsmVdCore
27
27
  update_params = {}
28
28
  update_params[:notes] = note
29
29
  update_params[:state] = 'CASH_BACK'
30
- update_params[:real_amount] = self.express_service_fee - (self.earn_amount - self.order_amount + self.order.real_shipping_charge * 2) - reduce_real_amount
31
- #here to avoid muliti time making refuse
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
@@ -24,6 +24,11 @@ module BlsmVdCore
24
24
  sprintf('%0.2f', fee.to_f).to_f
25
25
  end
26
26
 
27
+ #到付押金开关状态
28
+ def toggle_delivery_deposit
29
+ (self.toggle_setting.to_i & 0b00000001) == 1
30
+ end
31
+
27
32
  #是否是自动售货机的订单
28
33
  def ubox_order?
29
34
  self.ubox_vm
@@ -1,3 +1,3 @@
1
1
  module BlsmVdCore
2
- VERSION = "0.7.7"
2
+ VERSION = "0.7.8"
3
3
  end
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.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-11-25 00:00:00.000000000 Z
12
+ date: 2016-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec