Files
echart/DB_REFERENCE.md
T
simonandClaude Opus 4.7 ef123c697f refactor: 废弃机构持仓图表页面,整理数据库表引用文档
- 将 chartSix.php、chartThree.php、stock_ih.php、index_ih.php 移至 deprecated/
- 从 index.php、index-2.php 移除对应导航链接
- 新增 DB_REFERENCE.md,完整记录 16 张数据库表的使用状态
- 更新 continuation.md

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-07 08:30:15 +08:00

60 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 数据库表引用清单
数据库:`myquant`(配置在 `inc/config.php`
共 16 张表,其中 13 张在使用,3 张未使用。
## 全表清单
### 股票交易记录(2 张,均在用)
| 表名 | 状态 | 用途 | 引用文件 |
|------|------|------|---------|
| `trade_record` | ✅ 在用 | 方正证券交易记录 | `inc/ajax.inc.php``inc/tradeRec.inc.php``inc/widgets.inc.php``inc/excelOperate.inc.php` |
| `trade_record_cj` | ✅ 在用 | 长江证券交易记录 | `inc/ajax.inc.php``inc/tradeRec.inc.php``inc/widgets.inc.php``inc/excelOperate.inc.php` |
### 股票行情与基本面(4 张,2 张在用,2 张未使用)
| 表名 | 状态 | 用途 | 引用文件 |
|------|------|------|---------|
| `stock_his_pro` | ✅ 在用 | 股票历史日线行情(复权价) | `inc/getBasic.inc.php``inc/tradeRec.inc.php` |
| `stock_all_pro` | ✅ 在用 | 股票代码↔名称对照 | `inc/getBasic.inc.php` |
| `stock_his_basic_pro` | ❌ 未使用 | 历史基本面(PE/PB/PS) | 被 `getBasicData()` 查询,该函数唯一调用在 `deprecated/chartStDetail.php:14` 且已注释 |
| `stock_basic_ext` | ❌ 未使用 | 总市值/流通市值/股本等 | 被 `getBasicExtData()` 查询,该函数全项目无调用者 |
### 指数与资金流向(4 张,3 张在用,1 张未使用)
| 表名 | 状态 | 用途 | 引用文件 |
|------|------|------|---------|
| `index_hist_pro` | ✅ 在用 | 指数历史日线行情 | `inc/getData.inc.php` |
| `moneyflow_hsgt_pro` | ✅ 在用 | 沪深港通资金流向(原始值) | `inc/getData.inc.php` |
| `moneyflow_hsgt_pro_ext` | ✅ 在用 | 沪深港通资金流向(累积值) | `inc/getData.inc.php` |
| `ih_by_ts_code_ext` | ❌ 未使用 | 机构持仓(基金/QFII/社保/券商/保险/信托) | 被 `getIhData()` / `getIhDataByStock()` 查询,原调用 `chartSix.php` / `chartThree.php` 已移至 `deprecated/`,当前无活跃调用者 |
### 房地产数据(3 张,均在用)
| 表名 | 状态 | 用途 | 引用文件 |
|------|------|------|---------|
| `estate_json` | ✅ 在用 | 新房/二手房成交挂牌主表 | `inc/getEstate.inc.php``inc/ajax.inc.php` |
| `estate_json_ext` | ✅ 在用 | 房地产扩展属性(区域/面积/价格) | `inc/getEstate.inc.php``inc/ajax.inc.php` |
| `estate_listing` | ✅ 在用 | 二手房每日挂牌套数 | `inc/getEstate.inc.php` |
### 宏观研究(1 张,在用)
| 表名 | 状态 | 用途 | 引用文件 |
|------|------|------|---------|
| `mac_report` | ✅ 在用 | 宏观研究报告 | `quant/index.php``quant/report.php` |
### 系统日志(2 张,均在用)
| 表名 | 状态 | 用途 | 引用文件 |
|------|------|------|---------|
| `pv_log` | ✅ 在用 | 页面访问日志 | `inc/functions.inc.php` |
| `pv_counter` | ✅ 在用 | 页面访问计数器 | `inc/functions.inc.php` |
## 说明
- 所有 SQL 查询均通过 `db_query()` 参数化查询(prepare/execute),`excelOperate.inc.php` 中 insert 操作用字符串拼接
- 部分较新页面(`stock_trend.php``stockdiv.php` 等)通过 JS fetch 调用 `https://api.doorcome.cn/api/*`,不直接查询数据库
- `deprecated/` 目录中的文件已排除,不纳入统计