获取whatsApp

This commit is contained in:
2026-01-30 09:27:41 +08:00
parent 98cebae405
commit 8c910d8034
@@ -46,8 +46,7 @@ class WordpressVisitorService
$visitor->updated_at = time(); $visitor->updated_at = time();
$visitor->save(); $visitor->save();
$user = User::where('id',$visitor['user_id'])->first(); $user = User::where('id',$visitor['user_id'])->first();
//return $user['phone']; return $this->url($user['whatsapp'], $referer);
return $this->url($user['phone'], $referer);
} }
$lastId = Redis::get('wp_whatsApp_user'); $lastId = Redis::get('wp_whatsApp_user');
@@ -59,7 +58,8 @@ class WordpressVisitorService
$userIds = User::where('role',1) $userIds = User::where('role',1)
->where('whatsapp','!=','') ->where('whatsapp','!=','')
->orderBy('id','asc') ->orderBy('id','asc')
->get(); ->get()
->toArray();
$userIds = array_column($userIds, 'id'); $userIds = array_column($userIds, 'id');
$userIds = array_values($userIds); $userIds = array_values($userIds);
$id = 0; $id = 0;
@@ -82,7 +82,7 @@ class WordpressVisitorService
WordpressVisitor::create($data); WordpressVisitor::create($data);
$user = User::where('id',$id)->first(); $user = User::where('id',$id)->first();
//return $user['phone']; //return $user['phone'];
return $this->url($user['phone'], $referer); return $this->url($user['whatsapp'], $referer);
} }
public function url($phone,$referer){ public function url($phone,$referer){