wesmiler hace 5 meses
padre
commit
c9cf4c19e2
Se han modificado 2 ficheros con 6 adiciones y 2 borrados
  1. 5 1
      app/Services/Api/MemberService.php
  2. 1 1
      app/Services/MpService.php

+ 5 - 1
app/Services/Api/MemberService.php

@@ -499,7 +499,7 @@ class MemberService extends BaseService
             return $info;
         }
 
-        $defaultField = ['id', 'user_type', 'realname', 'mobile', 'nickname', 'balance', 'code', 'openid', 'status', 'avatar'];
+        $defaultField = ['id', 'user_type', 'realname', 'mobile', 'nickname','qrcode', 'balance', 'code', 'openid', 'status', 'avatar'];
         $field = $field ? $field : $defaultField;
         if (is_array($where)) {
             $info = $this->model->with(['store', 'agent'])->where(['mark' => 1])->where($where)->select($field)->first();
@@ -534,6 +534,10 @@ class MemberService extends BaseService
                 $info['team_count'] = $this->getTeamCount($info['id']);
             }
 
+            if($type == 'agent'){
+                $info['qrcode'] = MpService::make()->getMiniQrcode('pages/login/login',"rid={$info['id']}");
+            }
+
             RedisService::set($cacheKey, $info, rand(30, 60));
         }
 

+ 1 - 1
app/Services/MpService.php

@@ -164,7 +164,7 @@ class MpService extends BaseService
                 return false;
             }
 
-            $cacheKey = "caches:mpQrcode:mp_{$this->mpAppid}:";
+            $cacheKey = "caches:members:mp_{$this->mpAppid}:";
             $filePath = base_path('public/uploads');
             $qrFile = '/qrcodes/mp_'.date("YmdHis")."_".md5($page.$scene).".png";
             $qrKey = md5($qrFile);