tourze/wechat-work-external-contact-stats-bundle
最新稳定版本:0.0.1
Composer 安装命令:
composer require tourze/wechat-work-external-contact-stats-bundle
包简介
企业微信外部联系人行为数据统计管理束包
README 文档
README
[]
(https://packagist.org/packages/tourze/wechat-work-external-contact-stats-bundle)
[
]
(https://github.com/tourze/php-monorepo/actions)
[
]
(https://codecov.io/gh/tourze/php-monorepo)
[
]
(https://packagist.org/packages/tourze/wechat-work-external-contact-stats-bundle)
[
]
(https://packagist.org/packages/tourze/wechat-work-external-contact-stats-bundle)
A Symfony bundle for collecting and managing WeChat Work external contact statistics data.
Features
- Collect user behavior statistics for WeChat Work external contacts
- Support both user-level and department-level statistics
- Automatic data synchronization via cron jobs
- Comprehensive data entities and repositories
- Statistical analysis for contact applications, messages, and reply rates
Requirements
- PHP 8.1+
- Symfony 6.4+
- Doctrine ORM 3.0+
- WeChat Work API access
Installation
composer require tourze/wechat-work-external-contact-stats-bundle
Configuration
Add the bundle to your config/bundles.php:
<?php return [ // ... other bundles WechatWorkExternalContactStatsBundle\WechatWorkExternalContactStatsBundle::class => ['all' => true], ];
Usage
Entities
The bundle provides two main entities:
UserBehaviorDataByUser
Tracks individual user behavior statistics:
- New application count
- New contact count
- Chat count
- Message count
- Average reply time
- Negative feedback count
- Reply percentage
UserBehaviorDataByParty
Tracks department-level behavior statistics with the same metrics as user-level data.
Commands
Sync User Behavior Data
# Sync user behavior statistics data
php bin/console wechat-work:sync-user-behavior-by-user
This command runs automatically via cron job at 6:14 AM daily.
Repository Usage
use WechatWorkExternalContactStatsBundle\Entity\UserBehaviorDataByUser; use WechatWorkExternalContactStatsBundle\Entity\UserBehaviorDataByParty; use WechatWorkExternalContactStatsBundle\Repository\UserBehaviorDataByUserRepository; use WechatWorkExternalContactStatsBundle\Repository\UserBehaviorDataByPartyRepository; // Get user behavior data $userRepository = $entityManager->getRepository(UserBehaviorDataByUser::class); $userStats = $userRepository->findBy(['user' => $user]); // Get department behavior data $partyRepository = $entityManager->getRepository(UserBehaviorDataByParty::class); $departmentStats = $partyRepository->findBy(['party' => $department]);
Advanced Usage
API Integration
The bundle integrates with WeChat Work API to fetch:
- Follow user lists
- User behavior statistics
- Contact interaction data
Custom Queries
You can create custom queries using the repository methods:
// Find statistics for a specific date range $stats = $userRepository->createQueryBuilder('u') ->where('u.date BETWEEN :start AND :end') ->setParameter('start', $startDate) ->setParameter('end', $endDate) ->getQuery() ->getResult();
Dependencies
tourze/wechat-work-bundle- Core WeChat Work functionalitytourze/wechat-work-external-contact-bundle- External contact managementtourze/symfony-cron-job-bundle- Cron job scheduling
Contributing
Please see CONTRIBUTING.md for details.
Security
If you discover any security related issues, please email security@tourze.com instead of using the issue tracker.
License
This bundle is released under the MIT license. See the LICENSE file for details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-05