|
|
|
@@ -22,23 +22,26 @@ class SessionUser |
|
|
|
private bool $isSwtiched = false; |
|
|
|
private bool $isInit = false; |
|
|
|
|
|
|
|
public function init() |
|
|
|
public function init(array $param = []) |
|
|
|
{ |
|
|
|
if ($this->isInit === true) { |
|
|
|
return; |
|
|
|
} |
|
|
|
$this->initSessionUser(); |
|
|
|
$this->initSessionUser($param); |
|
|
|
$this->isInit = true; |
|
|
|
} |
|
|
|
private function initSessionUser() |
|
|
|
private function initSessionUser(array $param) |
|
|
|
{ |
|
|
|
// 認証していない場合はスキップ |
|
|
|
$this->user = Auth::user(); |
|
|
|
|
|
|
|
if ($this->user instanceof User && $this->user->customer_id) { |
|
|
|
HtpmsCustomerConnectionSwitch::switch($this->user->customer_id); |
|
|
|
} else if (!!data_get($param, "customer_id")) { |
|
|
|
HtpmsCustomerConnectionSwitch::switch(data_get($param, "customer_id")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$user = Auth::user(); |
|
|
|
$ckeck = Auth::check(); |
|
|
|
if ($this->user === null) { |
|
|
|
@@ -123,6 +126,12 @@ class SessionUser |
|
|
|
if ($this->user->customer_code === null) throw new LogicException(); |
|
|
|
return $this->user->customer_code; |
|
|
|
} |
|
|
|
public function customerId(): int |
|
|
|
{ |
|
|
|
if ($this->user === null) throw new LogicException(); |
|
|
|
if ($this->user->customer_id === null) throw new LogicException(); |
|
|
|
return $this->user->customer_id; |
|
|
|
} |
|
|
|
|
|
|
|
private function getStoreKey(string $key): string |
|
|
|
{ |
|
|
|
|