Progress on order progress

This commit is contained in:
Deon George
2020-04-19 08:33:41 +10:00
parent e6f823da39
commit 6480f40b22
16 changed files with 505 additions and 224 deletions

View File

@@ -64,6 +64,16 @@ class User extends Authenticatable
protected $with = ['accounts'];
/**
* Role hierarchy order
* @var array
*/
public static $role_order = [
'wholesaler',
'reseller',
'customer',
];
/**
* The accounts that this user manages
*
@@ -452,7 +462,7 @@ class User extends Authenticatable
public function client_service_movements(): DatabaseCollection
{
return Service::active()
->select(['id','account_id','product_id','order_status'])
->select(['id','account_id','product_id','order_status','model'])
->where('order_status','!=','ACTIVE')
->whereIN('account_id',$this->all_accounts()->pluck('id')->unique()->toArray())
->with(['account','product'])