condition changes for category filter

This commit is contained in:
rahul shukla 2019-08-14 12:02:30 +05:30
parent a6f5ebb90f
commit 909dbb51f0
4 changed files with 26 additions and 12 deletions

View File

@ -286,14 +286,14 @@ class DashboardController extends Controller
private function getOrdersBetweenDate($start, $end)
{
return $this->order->scopeQuery(function ($query) use ($start, $end) {
return $query->where('orders.created_at', '>=', $start)->where('orders.created_at', '<=', $end);
return $query->where('orders.status', '<>', 'canceled')->where('orders.created_at', '>=', $start)->where('orders.created_at', '<=', $end);
});
}
private function getCustomersBetweenDates($start, $end)
{
return $this->customer->scopeQuery(function ($query) use ($start, $end) {
return $query->where('customers.created_at', '>=', $start)->where('customers.created_at', '<=', $end);
return $query->where('customers.created_at', '>=', $start)->where('customers.created_at', '<=', $end)->where('customers.status', '=', 1);
});
}
}

View File

@ -75,7 +75,7 @@ class RegistrationController extends Controller
$data['is_verified'] = 1;
}
$data['customer_group_id'] = $this->customerGroup->findOneWhere(['code' => 'general'])->id;
$data['customer_group_id'] = 1;
$verificationData['email'] = $data['email'];
$verificationData['token'] = md5(uniqid(rand(), true));

View File

@ -6,9 +6,10 @@
<?php
$filterAttributes = [];
$products = $productRepository->getAll($category->id);
if (isset($category)) {
$products = $productRepository->getAll($category->id);
if (count($category->filterableAttributes) > 0 && count($products)) {
$filterAttributes = $category->filterableAttributes;
} else {

View File

@ -1,9 +1,6 @@
<?php
namespace Webkul\Theme;
use Illuminate\Support\Facades\Event;
class ViewRenderEventManager
{
/**
@ -12,14 +9,12 @@ class ViewRenderEventManager
* @var array
*/
protected $templates = [];
/**
* Paramters passed with event
*
* @var array
*/
protected $params;
/**
* Fires event for rendering template
*
@ -36,6 +31,27 @@ class ViewRenderEventManager
return $this->templates;
}
/**
* get params
*
* @return array
*/
public function getParams()
{
return $this->params;
}
/**
* get param
*
* @param $name
*
* @return mixed
*/
public function getParam($name)
{
return optional($this->params)[$name];
}
/**
* Add templates for render
*
@ -46,7 +62,6 @@ class ViewRenderEventManager
{
array_push($this->templates, $template);
}
/**
* Renders templates
*
@ -55,13 +70,11 @@ class ViewRenderEventManager
public function render()
{
$string = "";
foreach ($this->templates as $template) {
if (view()->exists($template)) {
$string .= view($template, $this->params)->render();
}
}
return $string;
}
}