|
|
@@ -0,0 +1,64 @@
|
|
|
+### 依赖关系
|
|
|
+
|
|
|
+- **PHP**: ^8.1|^8.2
|
|
|
+- **Laravel**: ^10.0|^11.0
|
|
|
+- **Bagisto**: 2.x
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 安装步骤
|
|
|
+
|
|
|
+### 1. 确认插件已注册
|
|
|
+
|
|
|
+确保 `bootstrap/providers.php` 文件中已添加:
|
|
|
+
|
|
|
+Longyi\RewardPoints\Providers\RewardPointsServiceProvider::class,
|
|
|
+
|
|
|
+### 2. 运行数据库迁移
|
|
|
+php artisan migrate
|
|
|
+这将创建以下 5 个数据表:
|
|
|
+- `mw_reward_active_rules` - 积分活动规则表
|
|
|
+- `mw_reward_point_customer` - 客户积分表
|
|
|
+- `mw_reward_point_customer_sign` - 客户签到表
|
|
|
+- `mw_reward_point_history` - 积分历史表
|
|
|
+- `mw_reward_points_settings` - 积分设置表
|
|
|
+
|
|
|
+### 3. 初始化默认设置
|
|
|
+php artisan reward-points:init-settings
|
|
|
+### 4. 清理缓存
|
|
|
+php artisan cache:clear # 清除应用缓存
|
|
|
+php artisan config:clear # 清除配置缓存
|
|
|
+php artisan view:clear # 清除视图缓存
|
|
|
+php artisan route:clear # 清除路由缓存
|
|
|
+## 定时任务
|
|
|
+php artisan reward-points:check-expired
|
|
|
+### 配置 Cron
|
|
|
+在服务器的 crontab 中添加:
|
|
|
+每天凌晨 2 点检查过期积分
|
|
|
+0 2 * * * cd /path/to/bagisto && php artisan reward-points:check-expired
|
|
|
+或在 Laravel Scheduler 中配置(`app/Console/Kernel.php`):
|
|
|
+protected function schedule(Schedule $schedule): void {
|
|
|
+ $schedule->command('reward-points:check-expired')
|
|
|
+ ->dailyAt('02:00');
|
|
|
+}
|
|
|
+
|
|
|
+## 版本历史
|
|
|
+
|
|
|
+### v1.0.0 (2026-01-01)
|
|
|
+- ✨ 初始版本发布
|
|
|
+- ✅ 完整的积分管理系统
|
|
|
+- ✅ 多种积分获取方式
|
|
|
+- ✅ 积分抵扣功能
|
|
|
+- ✅ 积分有效期管理
|
|
|
+- ✅ 命令行初始化工具
|
|
|
+- ✅ 定时任务支持
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## 技术支持
|
|
|
+
|
|
|
+如有问题或建议,请联系开发团队。
|
|
|
+
|
|
|
+**开发者**: Longyi Team
|
|
|
+**邮箱**: dev@longyi.com
|
|
|
+**许可证**: MIT License
|