diff --git a/app/common/service/WordpressVisitorService.php b/app/common/service/WordpressVisitorService.php index c0336b6..7c2ed45 100644 --- a/app/common/service/WordpressVisitorService.php +++ b/app/common/service/WordpressVisitorService.php @@ -46,8 +46,7 @@ class WordpressVisitorService $visitor->updated_at = time(); $visitor->save(); $user = User::where('id',$visitor['user_id'])->first(); - //return $user['phone']; - return $this->url($user['phone'], $referer); + return $this->url($user['whatsapp'], $referer); } $lastId = Redis::get('wp_whatsApp_user'); @@ -59,7 +58,8 @@ class WordpressVisitorService $userIds = User::where('role',1) ->where('whatsapp','!=','') ->orderBy('id','asc') - ->get(); + ->get() + ->toArray(); $userIds = array_column($userIds, 'id'); $userIds = array_values($userIds); $id = 0; @@ -82,7 +82,7 @@ class WordpressVisitorService WordpressVisitor::create($data); $user = User::where('id',$id)->first(); //return $user['phone']; - return $this->url($user['phone'], $referer); + return $this->url($user['whatsapp'], $referer); } public function url($phone,$referer){