PreOrder fixes

This commit is contained in:
Prashant Singh 2019-06-24 18:25:47 +05:30
parent 7fd8122251
commit a7d1c5e518
4 changed files with 9 additions and 3 deletions

View File

@ -13,8 +13,12 @@ class EventServiceProvider extends ServiceProvider
* @var array
*/
protected $listen = [
// 'Illuminate\Auth\Events\Attempting' => [
// 'Webkul\AdminAuthCheck\Listeners\LoginAuthenticationAttempt'
// ], // make use of this to stop admins logging into other sites
'Illuminate\Auth\Events\Authenticated' => [
'Webkul\AdminAuthCheck\Listeners\LoginAuthenticationAttempt'
], // make use of this to stop admins logging into other sites
]
];
}

View File

@ -108,4 +108,4 @@ class CategoryRepository extends BaseCategoryRepository
return $parentCategories;
}
}
}

View File

@ -11,6 +11,7 @@ class CustomerObserver
public function creating(Customer $model)
{
if (! auth()->guard('super-admin')->check()) {
$model->status = 1;
$model->company_id = Company::getCurrent()->id;
}
}

View File

@ -26,7 +26,8 @@ class PreOrder extends DataGrid
->addSelect('pre_order_items.id', 'pre_order_items.order_id', 'order_items.name as product_name', 'orders.customer_email', 'order_item_id', 'preorder_type', 'pre_order_items.status', 'base_paid_amount', 'pre_order_items.email_sent', 'base_remaining_amount', 'payment_order_items.order_id as payment_order_id')
->addSelect(DB::raw('CONCAT(orders.customer_first_name, " ", orders.customer_last_name) as customer_name'));
$this->addFilter('order_id', 'pre_order_items.order_id');
$this->addFilter('id', 'pre_order_items.id');
$this->addFilter('status', 'pre_order_items.status');
$this->addFilter('payment_order_id', 'payment_order_items.order_id');
$this->addFilter('product_name', 'order_items.name');
$this->addFilter('customer_name', DB::raw('CONCAT(orders.customer_first_name, " ", orders.customer_last_name)'));