Zory 2 viikkoa sitten
vanhempi
sitoutus
506ddf63ab
1 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 4 3
      app/controller/common/Login.php

+ 4 - 3
app/controller/common/Login.php

@@ -93,12 +93,12 @@ class Login extends Base
     }
 
     #[GetMapping('profile')]
-    public function getLoginUser()
+    public function getLoginUser(): Response
     {
         try {
             $userData = (new Auth)->guard("admin")->user()->toArray();
             if (isset($userData['password'])) unset($userData['password']);
-            $agent = [];
+            $agent = (new SaasStore)->where("poi_id",$userData['store_id'])->findOrEmpty();
             if (empty($agent['vip_end']))
             {
                 $userData['vip_end'] = 0;
@@ -110,8 +110,9 @@ class Login extends Base
                 "truename"  => $userData['truename'],
                 "vip_at"    => $userData['vip_end'],
                 "agent_id"  => $userData['agent_id'],
+                "store_id"  => $userData['store_id'],
                 "super"     => $userData['is_super'],
-                "shop"      => $agent['shop_name']??'',
+                "shop"      => $agent['poi_name']??'',
                 "type"      => $userData['type']
             ]);
         } catch (\Throwable $throwable) {