获取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->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){