blsm-vd-core 0.7.2 → 0.7.3
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.rb +28 -1
- data/lib/blsm-vd-core/model/recharge_spread.rb +6 -0
- data/lib/blsm-vd-core/model/setting.rb +15 -0
- data/lib/blsm-vd-core/model/user_spread.rb +7 -0
- data/lib/blsm-vd-core/model/vd_rc_msg_notify.rb +34 -7
- data/lib/blsm-vd-core/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d900f262f49e3f750e6e1282ba46eae80e3a2e8c
|
4
|
+
data.tar.gz: 457b226937b09497e4700586b591f779ebaf8adf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8eeca634abbb9c5745888b419ce0fa1f0a1c32914626c46e31e49ebf7dae37f0a54662911e81b23ca3d333afdec03aa9ad197bfcb32bfc3ae441b861f8097d4
|
7
|
+
data.tar.gz: eb42d8cf00896b68a771f955c450773513dccf549f66cef609d2e0a0123df8384c7c67d98cd6e68fca13d3b3e7078c238750324ec657d3afa96008b2d7e4a956
|
data/Gemfile.lock
CHANGED
data/lib/blsm-vd-core.rb
CHANGED
@@ -22,6 +22,9 @@ require 'blsm-vd-core/model/vd_rc_msg_notify'
|
|
22
22
|
require 'blsm-vd-core/model/rc_user'
|
23
23
|
require 'blsm-vd-core/model/user'
|
24
24
|
require 'blsm-vd-core/model/application'
|
25
|
+
require 'blsm-vd-core/model/setting'
|
26
|
+
require 'blsm-vd-core/model/recharge_spread'
|
27
|
+
require 'blsm-vd-core/model/user_spread'
|
25
28
|
require 'faraday'
|
26
29
|
require 'blsm-mp-wx'
|
27
30
|
|
@@ -332,7 +335,9 @@ module BlsmVdCore
|
|
332
335
|
|
333
336
|
#融云推送
|
334
337
|
if leader.rc_user
|
335
|
-
VdRcMsgNotify.create_score_change_notify(leader.id,
|
338
|
+
VdRcMsgNotify.create_score_change_notify(leader.id,
|
339
|
+
"首趣黑带#{leader.username},你好,你的队员【#{seller.username}】订单#{order.number}已成功签收,分销#{franchise_sum}元",
|
340
|
+
leader_change, '积分', leader_info.score)
|
336
341
|
end
|
337
342
|
|
338
343
|
#微信通知
|
@@ -391,6 +396,28 @@ module BlsmVdCore
|
|
391
396
|
end
|
392
397
|
end
|
393
398
|
|
399
|
+
#订单签收,加粉充值自动增加10元
|
400
|
+
fans_rewards = Setting.vd_order_sign_fans_rewards
|
401
|
+
if fans_rewards && fans_rewards[:order_money]>0 && fans_rewards[:reward_money]>0 && (order.shipping_charge+order.item_total)>= fans_rewards[:order_money]
|
402
|
+
|
403
|
+
user_spread = UserSpread.where(user_id: seller.id).first
|
404
|
+
if user_spread
|
405
|
+
UserSpread.update_counters(user_spread.id, :amount => fans_rewards[:reward_money])
|
406
|
+
RechargeSpread.create({amount: fans_rewards[:reward_money], user_spread_id: user_spread.id, r_type: 1, admin_id: 3, notes: "订单#{order.id}签收奖励"})
|
407
|
+
|
408
|
+
puts "seller:#{seller},rc_user:#{seller.rc_user}"
|
409
|
+
|
410
|
+
#融云推送
|
411
|
+
if seller.rc_user
|
412
|
+
VdRcMsgNotify.create_order_sign_fans_notify(seller.id,
|
413
|
+
fans_rewards[:reward_money],
|
414
|
+
order.number,
|
415
|
+
"尊敬的店主#{seller.username},您好,您的订单#{order.number}已成功签收,首趣奖励您粉丝推广费#{fans_rewards[:reward_money]}元")
|
416
|
+
end
|
417
|
+
end
|
418
|
+
|
419
|
+
end
|
420
|
+
|
394
421
|
#安全库录入信息
|
395
422
|
VdInfoSec.committed(vd_transaction)
|
396
423
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
module BlsmVdCore
|
3
|
+
class Setting < BlsmVdCore::BaseRecord
|
4
|
+
self.table_name='settings'
|
5
|
+
|
6
|
+
|
7
|
+
#订单签收,奖励加粉金额
|
8
|
+
def self.vd_order_sign_fans_rewards
|
9
|
+
setting = Setting.where(name: 'vd_order_sign_fans_reward').pluck(:value)[0]
|
10
|
+
return nil unless setting
|
11
|
+
array = setting.split('|')
|
12
|
+
{order_money: array[0].to_i, reward_money: array[1].to_i}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -39,7 +39,7 @@ module BlsmVdCore
|
|
39
39
|
"客户信息:#{order.ubox_order? ? "售货机#{order.ubox_vmid}扫码用户" : "#{order.shipping_province} #{order.name} #{order.phone}"}",
|
40
40
|
"买家留言:#{order.comment}"
|
41
41
|
],
|
42
|
-
url: "http://
|
42
|
+
url: "http://m.shouqu360.com/mobile/jms_orders/#{order.to_param}"
|
43
43
|
}.to_json
|
44
44
|
})
|
45
45
|
|
@@ -70,7 +70,7 @@ module BlsmVdCore
|
|
70
70
|
"客户信息:#{order.ubox_order? ? "售货机#{order.ubox_vmid}扫码用户" : "#{order.shipping_province} #{order.name} #{order.phone}"}",
|
71
71
|
"买家留言:#{order.comment}"
|
72
72
|
],
|
73
|
-
url: "http://
|
73
|
+
url: "http://m.shouqu360.com/mobile/jms_orders/#{order.to_param}"
|
74
74
|
}.to_json
|
75
75
|
})
|
76
76
|
|
@@ -101,7 +101,7 @@ module BlsmVdCore
|
|
101
101
|
"预收积分:#{score}",
|
102
102
|
"备注:订单签收后您会获取相应积分"
|
103
103
|
],
|
104
|
-
url: "http://
|
104
|
+
url: "http://m.shouqu360.com/mobile/jms_orders/#{order.to_param}/only_show"
|
105
105
|
}.to_json
|
106
106
|
})
|
107
107
|
|
@@ -132,7 +132,7 @@ module BlsmVdCore
|
|
132
132
|
"订单金额:#{order.total_fee}",
|
133
133
|
"预计收入:#{order.jm_profit}元"
|
134
134
|
],
|
135
|
-
url: "http://
|
135
|
+
url: "http://m.shouqu360.com/mobile/jms_orders/#{order.to_param}/only_show?change=√"
|
136
136
|
}.to_json
|
137
137
|
})
|
138
138
|
|
@@ -144,7 +144,7 @@ module BlsmVdCore
|
|
144
144
|
# msg_content['change'] 结算金额
|
145
145
|
# msg_content['account_type'] 账户类型
|
146
146
|
# msg_content['total'] 账户总余额
|
147
|
-
def self.create_account_change_notify(user_id, body, money, account_type, total, url='http://
|
147
|
+
def self.create_account_change_notify(user_id, body, money, account_type, total, url='http://m.shouqu360.com/mobile/my_clearings')
|
148
148
|
user = BlsmVdCore::User.where(id: user_id).first
|
149
149
|
return nil unless user && user.rc_user
|
150
150
|
|
@@ -177,7 +177,7 @@ module BlsmVdCore
|
|
177
177
|
# msg_content['change'] 结算金额
|
178
178
|
# msg_content['account_type'] 账户类型
|
179
179
|
# msg_content['total'] 账户总余额
|
180
|
-
def self.create_score_change_notify(user_id, body, change, account_type, total, url='http://
|
180
|
+
def self.create_score_change_notify(user_id, body, change, account_type, total, url='http://m.shouqu360.com/mobile/my_scores')
|
181
181
|
user = BlsmVdCore::User.where(id: user_id).first
|
182
182
|
return nil unless user && user.rc_user
|
183
183
|
|
@@ -226,7 +226,34 @@ module BlsmVdCore
|
|
226
226
|
"积分变动:#{score_change}",
|
227
227
|
"积分余额:#{user.create_vd_user_info.score}"
|
228
228
|
],
|
229
|
-
url: 'http://
|
229
|
+
url: 'http://m.shouqu360.com/mobile/jms_orders'
|
230
|
+
}.to_json
|
231
|
+
})
|
232
|
+
|
233
|
+
end
|
234
|
+
|
235
|
+
|
236
|
+
#创建订单签收、积分加粉充值
|
237
|
+
def self.create_order_sign_fans_notify(user_id, reward_money, order_number, body)
|
238
|
+
user = BlsmVdCore::User.where(id: user_id).first
|
239
|
+
return nil unless user && user.rc_user
|
240
|
+
|
241
|
+
BlsmVdCore::VdRcMsgNotify.create({
|
242
|
+
user_id: 3,
|
243
|
+
to_ids: user.username,
|
244
|
+
to_type: 'single',
|
245
|
+
msg_type: 'CU:TemplateMsg',
|
246
|
+
title: '订单签收-粉丝推广奖励',
|
247
|
+
content: {
|
248
|
+
title: '订单签收-粉丝推广奖励',
|
249
|
+
content: {
|
250
|
+
body: body
|
251
|
+
},
|
252
|
+
items: [
|
253
|
+
"订单编号:#{order_number}",
|
254
|
+
"奖励金额:#{reward_money}"
|
255
|
+
],
|
256
|
+
url: 'http://m.shouqu360.com/mobile/user_spreads'
|
230
257
|
}.to_json
|
231
258
|
})
|
232
259
|
|
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.7.
|
4
|
+
version: 0.7.3
|
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-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -193,8 +193,11 @@ files:
|
|
193
193
|
- lib/blsm-vd-core/model/product.rb
|
194
194
|
- lib/blsm-vd-core/model/product_prop.rb
|
195
195
|
- lib/blsm-vd-core/model/rc_user.rb
|
196
|
+
- lib/blsm-vd-core/model/recharge_spread.rb
|
197
|
+
- lib/blsm-vd-core/model/setting.rb
|
196
198
|
- lib/blsm-vd-core/model/ubox_vm.rb
|
197
199
|
- lib/blsm-vd-core/model/user.rb
|
200
|
+
- lib/blsm-vd-core/model/user_spread.rb
|
198
201
|
- lib/blsm-vd-core/model/vd_info_sec.rb
|
199
202
|
- lib/blsm-vd-core/model/vd_rc_msg_notify.rb
|
200
203
|
- lib/blsm-vd-core/model/vd_user_info.rb
|