文件地址:app\services\user\UserServices.php
public function typeHead() { //全部会员 $all = $this->getCount([]); /** @var UserWechatuserServices $userWechatUser */ $userWechatUser = app()->make(UserWechatuserServices::class); //小程序会员 $routine = $userWechatUser->getCount(['w.user_type' => 'routine']); //公众号会员 $wechat = $userWechatUser->getCount(['w.user_type' => 'wechat']); //H5会员 $h5 = $userWechatUser->getCount(['w.openid' => '', 'u.user_type' => 'h5']); //pc会员 $pc = $userWechatUser->getCount(['w.openid' => '', 'u.user_type' => 'pc']); //app会员 $app = $userWechatUser->getCount(['w.user_type' => 'app']); return [ ['user_type' => '', 'name' => '全部会员', 'count' => $all], ['user_type' => 'routine', 'name' => '小程序会员', 'count' => $routine], ['user_type' => 'wechat', 'name' => '公众号会员', 'count' => $wechat], ['user_type' => 'h5', 'name' => 'H5会员', 'count' => $h5], ['user_type' => 'pc', 'name' => 'PC会员', 'count' => $pc], ['user_type' => 'app', 'name' => 'APP会员', 'count' => $app], ]; }