rawgento_db 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rawgento_db/query.rb +16 -0
- data/lib/rawgento_db/version.rb +1 -1
- 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: 87e6754345222fe3b02dfbd3b731100e390ffcab
|
4
|
+
data.tar.gz: cb4b3f40f287bb30715358a1b98e525adb5f5072
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ee470c82d5aaf074a9c916af2a5a562bb184dca48fe4a34eb5dc00aa7d72c228c30aee8071042301f6ad3ac0b1f1c5af2a8fa36105e3920a0ad921acc84fdaa
|
7
|
+
data.tar.gz: 199ac5db1a4a4e730ec93883e978b986be38fbab3fed8f18fbc34ae2660cb96aa373410d2e7542805dd0be629d7dee4fb56602a9826afca126c46504e0dd8010
|
data/lib/rawgento_db/query.rb
CHANGED
@@ -58,6 +58,12 @@ module RawgentoDB
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
def self.wrongly_not_in_stock settings=RawgentoDB.settings
|
62
|
+
query = "SELECT product_id FROM rlg15.cataloginventory_stock_item WHERE qty > 0 AND is_in_stock = 0;"
|
63
|
+
results = client(settings).query query
|
64
|
+
results.map{|r| r['product_id']}
|
65
|
+
end
|
66
|
+
|
61
67
|
# Newer version might require query via entity_id
|
62
68
|
# array('aggregation' => $collection->getResource()->getTable('sales/bestsellers_aggregated_monthly')),
|
63
69
|
# "e.entity_id = aggregation.product_id AND aggregation.store_id={$storeId} AND aggregation.period BETWEEN '{$fromDate}' AND '{$toDate}'",
|
@@ -150,6 +156,16 @@ module RawgentoDB
|
|
150
156
|
end.to_h
|
151
157
|
end
|
152
158
|
|
159
|
+
def self.attribute_int attribute_id, settings=RawgentoDB.settings
|
160
|
+
result = client(settings).query("
|
161
|
+
SELECT entity_id, value
|
162
|
+
FROM catalog_product_entity_int
|
163
|
+
WHERE attribute_id=#{attribute_id};")
|
164
|
+
result.map do |r|
|
165
|
+
[r['entity_id'], r['value']]
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
153
169
|
def self.attribute_option attribute_id, settings=RawgentoDB.settings
|
154
170
|
# Join
|
155
171
|
result = client(settings).query("
|
data/lib/rawgento_db/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rawgento_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Wolfsteller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rawgento_models
|