Some order processing

This commit is contained in:
Deon George
2018-08-23 15:17:26 +10:00
parent 90bcb7f5f1
commit 27fdb334d0
14 changed files with 333 additions and 27 deletions

View File

@@ -226,6 +226,7 @@ class User extends Authenticatable
return $result->flatten();
}
public function all_clients($level=0)
{
$result = collect();
@@ -286,6 +287,11 @@ class User extends Authenticatable
return in_array($this->role(),['wholesaler','reseller']);
}
public function isWholesaler()
{
return in_array($this->role(),['wholesaler']);
}
public function role()
{
// If I have agents and no parent, I am the wholesaler