conflict resolve

This commit is contained in:
rahul shukla 2019-08-14 12:25:40 +05:30
parent 436d71bb44
commit 700c45df1a
2 changed files with 12 additions and 25 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.status', '<>', 'canceled')->where('orders.created_at', '>=', $start)->where('orders.created_at', '<=', $end);
return $query->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)->where('customers.status', '=', 1);
return $query->where('customers.created_at', '>=', $start)->where('customers.created_at', '<=', $end);
});
}
}

View File

@ -1,6 +1,9 @@
<?php
namespace Webkul\Theme;
use Illuminate\Support\Facades\Event;
class ViewRenderEventManager
{
/**
@ -9,12 +12,14 @@ class ViewRenderEventManager
* @var array
*/
protected $templates = [];
/**
* Paramters passed with event
*
* @var array
*/
protected $params;
/**
* Fires event for rendering template
*
@ -30,28 +35,6 @@ 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];
}
/**
* get params
@ -74,6 +57,7 @@ class ViewRenderEventManager
{
return optional($this->params)[$name];
}
/**
* Add templates for render
*
@ -84,6 +68,7 @@ class ViewRenderEventManager
{
array_push($this->templates, $template);
}
/**
* Renders templates
*
@ -92,11 +77,13 @@ class ViewRenderEventManager
public function render()
{
$string = "";
foreach ($this->templates as $template) {
if (view()->exists($template)) {
$string .= view($template, $this->params)->render();
}
}
return $string;
}
}
}