vip(); $this->fpdx(); $this->visitor(); $this->recommendCancel(); $this->phoneNotCard(); $this->oncePair(); } public function vip() { dump("老用户召回-激活会员通知"); $uids = \DB::connection('mysql_datalog') ->table("notice_logs") ->where('title', '老用户召回-激活会员通知') ->distinct() ->pluck('uid'); $unsubscribe_count = Openid::whereIn('uid', $uids) ->where('public_id', 'gh_b598cb7474d8') ->where('subscribe', 0) ->count(); $vip_count = UserModel::where('be_vip_at', '>', 0)->whereIn('uid', $uids)->count(); dump("取关人数{$unsubscribe_count}"); dump("会员人数{$vip_count}"); } public function fpdx() { dump("老用户召回-对象包分配通知"); $uids = \DB::connection('mysql_datalog') ->table("notice_logs") ->where('title', '老用户召回-对象包分配通知') ->distinct() ->pluck('uid'); $unsubscribe_count = Openid::whereIn('uid', $uids) ->where('public_id', 'gh_b598cb7474d8') ->where('subscribe', 0) ->count(); $pair_count = PairModel::where('uid', $uids)->distinct('uid')->count(); dump("取关人数{$unsubscribe_count}"); dump("匹配人数{$pair_count}"); } public function visitor() { dump("老用户召回-访客通知"); $uids = \DB::connection('mysql_datalog') ->table("notice_logs") ->where('title', '老用户召回-访客通知') ->distinct() ->pluck('uid'); $unsubscribe_count = Openid::whereIn('uid', $uids) ->where('public_id', 'gh_b598cb7474d8') ->where('subscribe', 0) ->count(); dump("取关人数{$unsubscribe_count}"); } public function recommendCancel() { dump("交友卡片-卡片取消推荐通知"); $uids = \DB::connection('mysql_datalog') ->table("notice_logs") ->where('title', '交友卡片-卡片取消推荐通知') ->where('result', 1) ->distinct() ->pluck('uid'); $unsubscribe_count = Openid::whereIn('uid', $uids) ->where('public_id', 'gh_b598cb7474d8') ->where('subscribe', 0) ->count(); $number = $uids->count(); $card = PartnerModel::where('upload_at', '>', 1560873600)->whereIn('uid', $uids)->count(); dump("发送人数{$number}"); dump("取关人数{$unsubscribe_count}"); dump("更换照片人数{$card}"); } public function phoneNotCard() { dump("老用户召回-有手机号但无卡片者通知"); $uids = \DB::connection('mysql_datalog') ->table("notice_logs") ->where('title', '老用户召回-有手机号但无卡片者通知') ->distinct() ->pluck('uid'); $unsubscribe_count = Openid::whereIn('uid', $uids) ->where('public_id', 'gh_b598cb7474d8') ->where('subscribe', 0) ->count(); $number = $uids->count(); $card_count = UserModel::where('partner_id', '>', 0)->whereIn('uid', $uids)->count(); dump("发送人数{$number}"); dump("取关人数{$unsubscribe_count}"); dump("交友卡片人数{$card_count}"); } public function oncePair() { dump("老用户召回-仅参与过一次活动的用户"); $uids = \DB::connection('mysql_datalog') ->table("notice_logs") ->where('title', '老用户召回-仅参与过一次活动的用户') ->distinct() ->pluck('uid'); $unsubscribe_count = Openid::whereIn('uid', $uids) ->where('public_id', 'gh_b598cb7474d8') ->where('subscribe', 0) ->count(); $pair_count = PairModel::where('create_time', '>', 1560787200) ->whereIn('uid', $uids) ->distinct() ->count(); dump("取关人数{$unsubscribe_count}"); dump("报名人数{$pair_count}"); } }