0", "`is_sell`= 1 AND `feed_push_type`= 3", "`is_sell`= 1 AND `score`> 0 AND `feed_push_type`= 3", "`is_sell`= 1 AND `score`> 0 AND `feed_pool_level` != 'low' AND `feed_push_type` = 3" ]; foreach ($wheres as $where) { echo PartnerModel::when($sex, function ($query) use ($sex) { $query->where('sex', $sex); })->whereRaw($where)->count(); echo "\t"; echo PartnerModel::when($sex, function ($query) use ($sex) { $query->where('sex', $sex); })->whereRaw("`uid` IN( SELECT `uid` FROM `koudai`.`kddx_user_openid` WHERE `public_id`= 'gh_c94c95866ca5' AND `subscribe`= 1)")->whereRaw($where)->count(); echo "\t"; echo PartnerModel::when($sex, function ($query) use ($sex) { $query->where('sex', $sex); })->whereRaw("`uid` IN( SELECT `uid` FROM `koudai`.`kddx_user_openid` WHERE `public_id`= 'gh_b598cb7474d8' AND `subscribe`= 1 )")->whereRaw($where)->count(); echo "\t"; echo PartnerModel::when($sex, function ($query) use ($sex) { $query->where('sex', $sex); })->whereRaw("`uid` IN( SELECT `uid` FROM `koudai`.`kddx_user_openid` WHERE `public_id`= 'gh_c94c95866ca5' AND `subscribe`= 1 AND `uid` NOT IN( SELECT `uid` FROM `koudai`.`kddx_user_openid` WHERE `public_id`= 'gh_b598cb7474d8') AND `uid`> 0 AND `subscribe`= 1 )")->whereRaw($where)->count(); echo "\t"; echo PartnerModel::when($sex, function ($query) use ($sex) { $query->where('sex', $sex); })->whereRaw("`uid` IN( SELECT `uid` FROM `koudai`.`kddx_user_openid` WHERE `public_id`= 'gh_c94c95866ca5' AND `subscribe`= 1 AND `uid` IN( SELECT `uid` FROM `koudai`.`kddx_user_openid` WHERE `public_id`= 'gh_b598cb7474d8') AND `uid`> 0 AND `subscribe`= 1 )")->whereRaw($where)->count(); echo "\n"; } echo "---------------\n\n"; } } }