blsm-vd-core 0.8.9 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blsm-vd-core/version.rb +1 -1
- data/lib/blsm-vd-core.rb +7 -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: a115c91cf7c5e6a5ba4c64b73b167fe21b0cfdd0
|
4
|
+
data.tar.gz: 9b28f4df1fd5c1fe19eee72902f07c5aba3a562b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebd2c12cb6cb54af370ef8049807bc0ecec7bef5f10c37fa3c911478691f12bcaf9c19b94b1ac8d4af8b932d3239ef70bc7e9a10131105b75b6142ca0d7c2aa9
|
7
|
+
data.tar.gz: 205d34055b0690dc7a0925526a8533e5ed39369a12ea22123dfdce76e31005a1dde4343215c223cec0c38fb15c5b5940bff7c6e91564904048f58f596ad57059
|
data/lib/blsm-vd-core/version.rb
CHANGED
data/lib/blsm-vd-core.rb
CHANGED
@@ -142,14 +142,18 @@ module BlsmVdCore
|
|
142
142
|
product_ids = settings.value.to_s.split('|').map(&:to_i)
|
143
143
|
|
144
144
|
return ERROR_CODES[4048] if product_ids.size==0
|
145
|
-
|
145
|
+
|
146
|
+
product_count = order.line_items.inject(0) { |s, item| s+= product_ids.include?(item.product_id) ? 1*item.quantity : 0; s }
|
147
|
+
return ERROR_CODES[4047] unless product_count >0
|
146
148
|
|
147
149
|
#安全校验
|
148
150
|
vd_transaction = "order_export_to_erp_handle_#{order_id}"
|
149
151
|
danger = VdInfoSec.dangerous?(vd_transaction)
|
150
152
|
return danger if danger
|
151
|
-
|
152
|
-
|
153
|
+
product_count.times do
|
154
|
+
VdFreePost.create({user_id: seller.id})
|
155
|
+
end
|
156
|
+
content = "您获取到#{product_count}张顺丰免费券,点击查看 http://w.url.cn/s/AQsuRun"
|
153
157
|
VdMpMsg.create!({
|
154
158
|
app_id: BlsmMpWx.APP_ID,
|
155
159
|
openid: seller.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.
|
4
|
+
version: 0.9.0
|
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: 2017-01-
|
12
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|