Skip to content

Commit

Permalink
Remove NumVisit as no longer in SS4 (Fixes #666)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed Mar 19, 2019
1 parent c5fda4e commit adc623c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Model/OrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use SilverStripe\Forms\TextField;
use SilverStripe\ORM\FieldType\DBCurrency;


/**
* An order item is a product which has been added to an order,
* ready for purchase. An order item is typically a product itself,
Expand Down
4 changes: 2 additions & 2 deletions src/Page/CheckoutPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public function PaymentErrorMessage()

return $lastErrorMessage->Message;
}

/**
* Override viewer to get correct template for first step
*
*
* {@inheritDoc}
* @see \SilverStripe\CMS\Controllers\ContentController::getViewer()
*/
Expand Down
6 changes: 4 additions & 2 deletions src/Reports/CustomerReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function columns()
'Created' => 'Joined',
'Spent' => 'Spent',
'Orders' => 'Orders',
'NumVisit' => 'Visits',
'edit' => [
'title' => 'Edit',
'formatting' => '<a href=\"admin/security/EditForm/field/Members/item/$ID/edit\" target=\"_new\">edit</a>',
Expand All @@ -49,12 +48,15 @@ public function query($params)
$query = parent::query($params);
$query->selectField($this->periodfield, 'FilterPeriod')
->addSelect(
['"Member"."ID"', '"Member"."FirstName"', '"Member"."Surname"', '"Member"."Email"', '"Member"."NumVisit"', '"Member"."Created"']
['"Member"."ID"', '"Member"."FirstName"', '"Member"."Surname"', '"Member"."Email"', '"Member"."Created"']
)
->selectField('COUNT("SilverShop_Order"."ID")', 'Orders')
->selectField('SUM("SilverShop_Order"."Total")', 'Spent');

$query->addInnerJoin('SilverShop_Order', '"Member"."ID" = "SilverShop_Order"."MemberID"');

$query->addGroupBy('"Member"."ID"');

if (!$query->getOrderBy()) {
$query->setOrderBy(
[
Expand Down

0 comments on commit adc623c

Please sign in to comment.