File tree Expand file tree Collapse file tree 3 files changed +40
-78
lines changed
Reports/Model/Resource/Report
Sales/Model/Resource/Report/Bestsellers Expand file tree Collapse file tree 3 files changed +40
-78
lines changed Original file line number Diff line number Diff line change @@ -268,4 +268,44 @@ public function load($printQuery = false, $logQuery = false)
268
268
}
269
269
return parent ::load ($ printQuery , $ logQuery );
270
270
}
271
+
272
+
273
+ /**
274
+ * Get SQL for get record count
275
+ *
276
+ * @return Varien_Db_Select
277
+ */
278
+ public function getSelectCountSql ()
279
+ {
280
+ $ this ->_renderFilters ();
281
+ $ select = clone $ this ->getSelect ();
282
+ $ select ->reset (Zend_Db_Select::ORDER );
283
+ return $ this ->getConnection ()->select ()->from ($ select , 'COUNT(*) ' );
284
+ }
285
+
286
+ /**
287
+ * Set ids for store restrictions
288
+ *
289
+ * @param array $storeIds
290
+ * @return $this
291
+ */
292
+ public function addStoreRestrictions ($ storeIds )
293
+ {
294
+ if (!is_array ($ storeIds )) {
295
+ $ storeIds = [$ storeIds ];
296
+ }
297
+ $ currentStoreIds = $ this ->_storesIds ;
298
+ if (isset ($ currentStoreIds ) && $ currentStoreIds != Mage_Core_Model_App::ADMIN_STORE_ID
299
+ && $ currentStoreIds != [Mage_Core_Model_App::ADMIN_STORE_ID ]
300
+ ) {
301
+ if (!is_array ($ currentStoreIds )) {
302
+ $ currentStoreIds = [$ currentStoreIds ];
303
+ }
304
+ $ this ->_storesIds = array_intersect ($ currentStoreIds , $ storeIds );
305
+ } else {
306
+ $ this ->_storesIds = $ storeIds ;
307
+ }
308
+
309
+ return $ this ;
310
+ }
271
311
}
Original file line number Diff line number Diff line change @@ -157,45 +157,6 @@ protected function _initSelect()
157
157
return $ this ;
158
158
}
159
159
160
- /**
161
- * Get SQL for get record count
162
- *
163
- * @return Varien_Db_Select
164
- */
165
- public function getSelectCountSql ()
166
- {
167
- $ this ->_renderFilters ();
168
- $ select = clone $ this ->getSelect ();
169
- $ select ->reset (Zend_Db_Select::ORDER );
170
- return $ this ->getConnection ()->select ()->from ($ select , 'COUNT(*) ' );
171
- }
172
-
173
- /**
174
- * Set ids for store restrictions
175
- *
176
- * @param array $storeIds
177
- * @return $this
178
- */
179
- public function addStoreRestrictions ($ storeIds )
180
- {
181
- if (!is_array ($ storeIds )) {
182
- $ storeIds = [$ storeIds ];
183
- }
184
- $ currentStoreIds = $ this ->_storesIds ;
185
- if (isset ($ currentStoreIds ) && $ currentStoreIds != Mage_Core_Model_App::ADMIN_STORE_ID
186
- && $ currentStoreIds != [Mage_Core_Model_App::ADMIN_STORE_ID ]
187
- ) {
188
- if (!is_array ($ currentStoreIds )) {
189
- $ currentStoreIds = [$ currentStoreIds ];
190
- }
191
- $ this ->_storesIds = array_intersect ($ currentStoreIds , $ storeIds );
192
- } else {
193
- $ this ->_storesIds = $ storeIds ;
194
- }
195
-
196
- return $ this ;
197
- }
198
-
199
160
/**
200
161
* Redeclare parent method for applying filters after parent method
201
162
* but before adding unions and calculating totals
Original file line number Diff line number Diff line change @@ -158,45 +158,6 @@ protected function _initSelect()
158
158
return $ this ;
159
159
}
160
160
161
- /**
162
- * Get SQL for get record count
163
- *
164
- * @return Varien_Db_Select
165
- */
166
- public function getSelectCountSql ()
167
- {
168
- $ this ->_renderFilters ();
169
- $ select = clone $ this ->getSelect ();
170
- $ select ->reset (Zend_Db_Select::ORDER );
171
- return $ this ->getConnection ()->select ()->from ($ select , 'COUNT(*) ' );
172
- }
173
-
174
- /**
175
- * Set ids for store restrictions
176
- *
177
- * @param array $storeIds
178
- * @return $this
179
- */
180
- public function addStoreRestrictions ($ storeIds )
181
- {
182
- if (!is_array ($ storeIds )) {
183
- $ storeIds = [$ storeIds ];
184
- }
185
- $ currentStoreIds = $ this ->_storesIds ;
186
- if (isset ($ currentStoreIds ) && $ currentStoreIds != Mage_Core_Model_App::ADMIN_STORE_ID
187
- && $ currentStoreIds != [Mage_Core_Model_App::ADMIN_STORE_ID ]
188
- ) {
189
- if (!is_array ($ currentStoreIds )) {
190
- $ currentStoreIds = [$ currentStoreIds ];
191
- }
192
- $ this ->_storesIds = array_intersect ($ currentStoreIds , $ storeIds );
193
- } else {
194
- $ this ->_storesIds = $ storeIds ;
195
- }
196
-
197
- return $ this ;
198
- }
199
-
200
161
/**
201
162
* Redeclare parent method for applying filters after parent method
202
163
* but before adding unions and calculating totals
You can’t perform that action at this time.
0 commit comments