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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9aaa741a762100f9b61f54a2f5debd2ac75fbf40
4
- data.tar.gz: 1db216b834cfe1114f067fd4a426da51b3006ced
3
+ metadata.gz: 87e6754345222fe3b02dfbd3b731100e390ffcab
4
+ data.tar.gz: cb4b3f40f287bb30715358a1b98e525adb5f5072
5
5
  SHA512:
6
- metadata.gz: fe2119ffac12d5be22e1d950ab9b65bb255a532f584271cafca2d31de750a5d056f04d6414f42bdbbd40d48157703da4a25564bec7cd3144c7d781aa6e7f2c2a
7
- data.tar.gz: 05ae53d5dc24ca0b86c5293649e7069aefa2cea3fb91e2a1e43621da7fd68de05690fe24760c5b681267a8298e6aeea9f586faa963c84777d9290398c756fdcc
6
+ metadata.gz: 2ee470c82d5aaf074a9c916af2a5a562bb184dca48fe4a34eb5dc00aa7d72c228c30aee8071042301f6ad3ac0b1f1c5af2a8fa36105e3920a0ad921acc84fdaa
7
+ data.tar.gz: 199ac5db1a4a4e730ec93883e978b986be38fbab3fed8f18fbc34ae2660cb96aa373410d2e7542805dd0be629d7dee4fb56602a9826afca126c46504e0dd8010
@@ -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("
@@ -1,3 +1,3 @@
1
1
  module RawgentoDB
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-09 00:00:00.000000000 Z
11
+ date: 2016-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rawgento_models