zeusbart
1/4/2019 - 9:05 PM

busqueda de estafa

Busca las sesiones mas usadas en diferentes cuentas

## lista de dispositivo
SELECT device,count(*),slave.email FROM `user_sessions` left join slave on oid=slave_id where user_type=2 GROUP by device  
ORDER BY count(*)  DESC

## lista de dispositivo sin dispositivos ya bloqueados
SELECT device,count(*),slave.email 
FROM `user_sessions` 
left join slave on oid=slave_id where user_type=2  and
device not in (SELECT device from device_banned where device_banned.device=user_sessions.device )GROUP by device  
ORDER BY count(*)  DESC

## Detalle de las cuentas en el dispositivo
SELECT device,slave.created_dt,slave.phone,slave.email,slave.password,slave.status 
FROM `user_sessions`  left join slave on oid=slave_id where user_type=2 and device="991312363574906"

## ## Detalle de las cuentas con pagos pendientes
SELECT device,slave.created_dt,slave.phone,slave.email,slave.password,slave.status,pending_payment.amount,pending_payment.status,pending_payment.create_dt
FROM `user_sessions` 
left join slave on oid=slave_id
left join pending_payment on slave.slave_id=pending_payment.slave_id
where user_type=2 and device="864013030218513"