This commit is contained in:
huangguancheng 2025-01-10 10:48:21 +08:00
parent 0597f8abfd
commit 925b726d43

View File

@ -192,13 +192,14 @@ class BpsAdAccountService
// 获取 Google 第三方用户数据
public function getGoogleThirdUsers($options = [])
{
if (!empty($options)) {
$refreshToken = $options['refresh_token'];
$uid = $options['uid'] ?? null;
if ($uid) {
// 获取符合条件的用户数据
$users = ThirdUserAdvertiser::alias('tua')
->join('bps.bps_third_user tu', 'tua.doc_ = tu.id') // 连接 bps_third_user 表
->where('tu.third_type', 'google') // 筛选 third_type 为 google 的记录
->where('tu.access_token', $refreshToken) // 筛选 third_type 为 google 的记录
->where('tu.user_id', $uid) // 筛选 third_type 为 google 的记录
->field('tu.id, tu.access_token as refresh_token') // 获取相关字段
->select();
} else {
@ -221,13 +222,15 @@ class BpsAdAccountService
// 获取 TikTok 第三方用户数据
public function getTiktokThirdUsers($options = [])
{
if (!empty($options)) {
$refreshToken = $options['refresh_token'];
$uid = $options['uid'] ?? null;
if ($uid) {
// $refreshToken = $options['refresh_token'];
// 获取符合条件的用户数据
$users = ThirdUserAdvertiser::alias('tua')
->join('bps.bps_third_user tu', 'tua.doc_ = tu.id') // 连接 bps_third_user 表
->where('tu.third_type', 'tiktok') // 筛选 third_type 为 tiktok 的记录
->where('tu.access_token', $refreshToken) // 筛选 third_type 为 tiktok 的记录
->where('tu.access_token', $uid) // 筛选 third_type 为 tiktok 的记录
->field('tu.id, tu.access_token as refresh_token') // 获取相关字段
->select();
} else {