chore: init saasshop repo + sql migrations runner + gitee go

This commit is contained in:
萝卜
2026-03-10 11:31:02 +00:00
commit 50f15cdea8
210 changed files with 29534 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
# 2026-03-08 基础能力推进记录
## 本次完成
### 1. 补齐基础数据结构
- 新增 `product_categories`
- 字段:`merchant_id``name``slug``status``sort``description`
- 给 `products` 表新增 `category_id`
- 新增 `order_items`
- 字段:`merchant_id``order_id``product_id``product_title``product_sku``product_price``quantity``line_total_amount``snapshot`
### 2. 新增模型与关系
- `App\Models\ProductCategory`
- `App\Models\OrderItem`
- `Product` 增加:
- `category()`
- `orderItems()`
- `Order` 增加:
- `items()`
### 3. Seeder 扩展
- 初始化两个演示分类:
- 默认分类
- 精选商品
- 初始化第二个演示商品
- 初始化订单明细 2 条,覆盖多商品场景
- 初始化演示订单金额同步调整为 `397.00`
### 4. 商家后台展示增强
- 商品页已展示商品分类表
- 商品创建 / 编辑支持选择分类
- 订单详情页已展示订单明细
### 5. Redis 缓存接入(第一阶段)
- `.env` 已切换 `CACHE_STORE=redis`
- 新增缓存 key 辅助类:`App\Support\CacheKeys`
- 已缓存:
- 商家仪表盘统计
- 商家商品列表
- 已实现基础缓存失效:
- 商品新增 / 更新 / 删除
- 订单状态更新
## 影响范围
- migration
- model
- seeder
- merchant admin controllers
- merchant admin views
- docs
## 风险提示
- 由于新增 migration需要执行迁移
- 如果 Redis 服务异常,缓存层会受影响;但当前 `/health` 已可辅助确认 Redis 连通性
- 当前商品分类仅做基础展示,尚未独立做商家后台分类 CRUD
## 建议验证命令
```bash
cd /var/www/sites/app
php artisan migrate
php artisan db:seed --force
php artisan optimize:clear
php artisan route:list --path=merchant-admin
```
## 建议验证页面
- `/health`
- `/merchant-admin`
- `/merchant-admin/products`
- `/merchant-admin/orders`
- `/merchant-admin/orders/{id}`