rawgento_db 0.2.5 → 0.2.6

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: f995b7425325b490d4eb72b7c265c646fe656e3b
4
- data.tar.gz: a16433bc22a446e68bab2b844a1ceab674b87ca2
3
+ metadata.gz: 2f39b606713108b79c79caa29f5224c52319d9b5
4
+ data.tar.gz: a31ff5c1c3daed526632ce61ceee4ed559f0cfed
5
5
  SHA512:
6
- metadata.gz: 1aea8c9993095b4bd600c11f3bf14d5aaa8433c66e93d4d6b761199d289ca6cf05c05ce7e4231836890130f6fc272c7ea6dc59bf00b8fd1c3ad3d95dcfae34b6
7
- data.tar.gz: df1613dd026c18a6ed07d0e08a777e64b462b5eb9fd946fb897fd5ee9ea62eb55c1ec1cbf8e31f2c694e9927774abb4e9b01b954fb385f691c95d14f48d943a1
6
+ metadata.gz: d256a8127cadda9801c6138e681357a839aa95a1ee1b6a67309a87fd43f1fb5f8d68691410f468ed991ef05db98e57bdf1468aa88bfc959960af143ddfd4f862
7
+ data.tar.gz: 141b20254355411af8231aae27cb4a46c15af968b344e178720e14fe208502e5afea5e25d932230f672f543ef66980851516864195ed64e3c269c9f120db75c8
data/README.md CHANGED
@@ -59,6 +59,12 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
59
59
 
60
60
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
61
61
 
62
+ ### How to find magento attribute names and values
63
+
64
+ Some Attribute names/ids are found like this: `SELECT * FROM magentodb.eav_attribute_label;`
65
+
66
+ Most Attribute names/ids are found like this: `SELECT * FROM magentodb.eav_attribute;`
67
+
62
68
  ## Contributing
63
69
 
64
70
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rawgento_db. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -78,6 +78,7 @@ module RawgentoDB
78
78
  query = 'SELECT * '\
79
79
  'FROM sales_bestsellers_aggregated_daily '\
80
80
  'WHERE product_id = %d AND '\
81
+ 'store_id = 1 AND '\
81
82
  'period >= \'%s\' AND period <= \'%s\' '\
82
83
  'ORDER BY PERIOD DESC' % [product_id, min_date.strftime, max_date.strftime]
83
84
  result = client(settings).query(query)
@@ -91,6 +92,7 @@ module RawgentoDB
91
92
  query = 'SELECT DISTINCT * '\
92
93
  'FROM sales_bestsellers_aggregated_monthly '\
93
94
  'WHERE product_id = %d AND '\
95
+ 'store_id = 1 AND '\
94
96
  'period >= \'%s\' AND period <= \'%s\' '\
95
97
  'ORDER BY period DESC' % [product_id, min_date.strftime, max_date.strftime]
96
98
  result = client(settings).query(query)
@@ -121,7 +123,7 @@ module RawgentoDB
121
123
  query = "SELECT MIN(period), product_id "\
122
124
  "FROM sales_bestsellers_aggregated_daily "\
123
125
  "WHERE product_id in (%s) "\
124
- "GROUP BY product_id" % [product_ids.join(",")]
126
+ "GROUP BY product_id" % [[*product_ids].join(",")]
125
127
  result = client(settings).query(query)
126
128
  result.map do |r|
127
129
  [r['product_id'], r['MIN(period)']]
@@ -133,7 +135,8 @@ module RawgentoDB
133
135
  "FROM sales_bestsellers_aggregated_daily "\
134
136
  "WHERE product_id in (%s) "\
135
137
  " AND period >= '%s' "\
136
- "GROUP BY product_id" % [product_ids.join(","), day.strftime]
138
+ " AND store_id = 1 "\
139
+ "GROUP BY product_id" % [[*product_ids].join(","), day.strftime]
137
140
 
138
141
  result = client(settings).query(query)
139
142
  result.map do |r|
@@ -1,3 +1,3 @@
1
1
  module RawgentoDB
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6".freeze
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.5
4
+ version: 0.2.6
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-24 00:00:00.000000000 Z
11
+ date: 2016-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rawgento_models