Skip to content

Commit

Permalink
Fix for prefixed tables
Browse files Browse the repository at this point in the history
  • Loading branch information
bymayo committed Oct 14, 2018
1 parent 3b789dd commit da6a483
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Commerce Widgets Changelog

## 2.0.6 - 2018-10-14
### Fixed
- Fix prefixed tables [#9](https://github.com/bymayo/craft-commerce-widgets/issues/9)

## 2.0.5 - 2018-10-11
### Fixed
- Fix for classes not loading on case sensitive environments
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bymayo/commerce-widgets",
"description": "Insightful dashboard widgets for your Craft Commerce 2 store.",
"type": "craft-plugin",
"version": "2.0.5",
"version": "2.0.6",
"keywords": [
"craft",
"cms",
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/CartAbandonment.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getTotalCarts($isCompleted)
'COALESCE(COUNT(orders.id), 0) AS count'
]
)
->from(['orders' => 'commerce_orders'])
->from(['orders' => '{{%commerce_orders}}'])
->where(
[
'between', 'orders.dateCreated', date('Y-m-d', strtotime('-5 months')), date('Y-m-d', strtotime('+1 day'))
Expand Down Expand Up @@ -132,7 +132,7 @@ public function getCartTotalRevenue($isCompleted)
'COALESCE(count(orders.id), 0) as count'
]
)
->from(['orders' => 'commerce_orders'])
->from(['orders' => '{{%commerce_orders}}'])
->where(
[
'orders.isCompleted' => $isCompleted,
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/Goal.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getTotals()
'COALESCE(SUM(orders.totalPaid),0) as totalRevenue'
]
)
->from(['orders' => 'commerce_orders'])
->from(['orders' => '{{%commerce_orders}}'])
->where(
[
'orders.isCompleted' => 1,
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/SubscriptionPlans.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getSubscriptionPlans()
)
->from(
[
'plans' => 'commerce_plans'
'plans' => '{{%commerce_plans}}'
]
)
->join(
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/TopCustomers.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getCustomers()
'orders.customerId'
]
)
->from(['orders' => 'commerce_orders'])
->from(['orders' => '{{%commerce_orders}}'])
->where(['orders.isCompleted' => 1])
->orderBy($this->orderBy . ' desc')
->groupBy(['orders.email'])
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/TotalRevenueOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getRevenueOrdersRow($timeFrame)
'COALESCE(count(orders.id), 0) as totalOrders'
]
)
->from(['orders' => 'commerce_orders'])
->from(['orders' => '{{%commerce_orders}}'])
->where(
[
'orders.isCompleted' => 1
Expand Down

0 comments on commit da6a483

Please sign in to comment.