zz %!s(int64=5) %!d(string=hai) anos
pai
achega
2ac39e8cb1
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  1. 1 0
      app/Client/SiteUser.php
  2. 3 3
      app/Http/Middleware/CrmUser.php

+ 1 - 0
app/Client/SiteUser.php

@@ -54,6 +54,7 @@ class SiteUser
             $user = User::where('id', $friend_link_uid_bind->uid)->select('id', 'distribution_channel_id')->first();
             if ($user) {
                 $this->channel_id = $user->distribution_channel_id;
+                $this->user = [$user->id, $this->channel_id];
             }
         }
     }

+ 3 - 3
app/Http/Middleware/CrmUser.php

@@ -24,7 +24,7 @@ class CrmUser
             $this->setUserGlobal($uid, $channel_id);
         } else {
             $openid = $request->get('openid');
-            \Log::info('crm middleware info openid is :'.$openid);
+            //\Log::info('crm middleware info openid is :'.$openid);
             $params = $request->except('_url');
             if (empty($openid)) {
                 $url = url()->current() . '?' . http_build_query($params);
@@ -34,8 +34,8 @@ class CrmUser
             } else {
                 $site_user = new SiteUser($openid);
                 $user = $site_user->getChannelUser();
-                \Log::info('crm middleware info');
-                \Log::info($user);
+                //\Log::info('crm middleware info');
+                //\Log::info($user);
                 Cookie::queue('crm_user_id', $user[0], env('U_COOKIE_EXPIRE'));
                 Cookie::queue('crm_channel_id', $user[1], env('U_COOKIE_EXPIRE'));
                 $this->setUserGlobal($user[0], $user[1]);