diff --git a/DB_REFERENCE.md b/DB_REFERENCE.md new file mode 100644 index 0000000..2ac42b9 --- /dev/null +++ b/DB_REFERENCE.md @@ -0,0 +1,59 @@ +# 数据库表引用清单 + +数据库:`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/` 目录中的文件已排除,不纳入统计 diff --git a/continuation.md b/continuation.md index ce0d753..8a644d6 100644 --- a/continuation.md +++ b/continuation.md @@ -2,28 +2,42 @@ ## 当前状态 -前端库整理和图表模式标准化已完成并提交。 +已完成 CLAUDE.md 更新、Git 仓库初始化和推送、数据库表清单整理。 -### 前端库整理 -- 所有第三方 JS 库统一至 `lib/js/`(ECharts、jQuery、DataTables、Tailwind 等,按名称-版本命名) -- 所有 CSS 库至 `lib/css/`(Font Awesome、DataTables、Google Fonts) -- 字体文件至 `lib/webfonts/` -- 删除了约 30 个重复/废弃的库文件副本(lib/echarts/、lib/DataTables-2/、libai/fontawesome/、css/fontawesome/、research/webfonts/ 等) +## 已完成 -### 图表标准化 -- 5 个旧模式页面已转换为 `index_margin.php` 模式(fetch + loading overlay + 提交按钮) - - `moneyflow.php`、`realestate.php`、`estateTradeDaily.php`、`estateListDaily.php`、`estateNewTradeDaily.php` -- 新增 2 个 AJAX 端点(`moneyflowData`、`estateData`) -- 2 个死 JS 文件移至 deprecated(`chartmoneyflow.js`、`estate.js`) -- 8 个页面已在标准模式下,无需改动 +1. **CLAUDE.md 更新** + - 补充缺失页面:`chartSix.php`、`chartThree.php` + - 新增数据获取模式说明(传统 PHP 注入 vs JS fetch 调用外部 API) + - 新增 `quant/`、`api_document/` 子模块文档 + - 新增常用命令(php -l、composer、sync-echart) + - 合并 AGENTS.md 代码风格约定 -### 项目结构澄清 -- iframe 嵌入页(chartSix、chartStDetail、chartThree)保持原样——它们通过 URL 参数接收数据、查询本地 DB -- 非图表页(stockkeydata、stockTradeRecord、myexcel)保持原样 +2. **Git 仓库连接与推送** + - 初始化 git 仓库,连接 `https://github.com/Simon2046/echarts` + - 合并本地较新代码到远程 main 分支 + - 提交 eedead0,228 个文件变更 + - `.gitignore` 新增排除规则:`.mcp.json`、`.serena/`、`uploads/`、`xls/`、`*.map` -## 后续步骤 -1. 浏览器验证转换后的页面:moneyflow、realestate、estate 系列 -2. 后续可考虑将 iframe 页面的本地 DB 查询也改为 fetch + AJAX 端点模式 +3. **数据库表清单整理** + - 扫描全项目,识别出 16 张 MySQL 表 + - 发现 2 张死代码表:`stock_his_basic_pro`、`stock_basic_ext` + - 生成 `DB_REFERENCE.md` -## 待解决问题 -- README.md 已更新,包含完整功能说明和项目结构 +## 当前工作 + +无进行中的任务。 + +## 未完成 + +- 无 + +## 关键设计决策 + +- 代理服务器配置已记录 memory,仅网络连接问题时使用(socks5://127.0.0.1:1086 / http://127.0.0.1:1087) +- `.mcp.json` 和 `.serena/` 不提交到 git 仓库 +- 二进制 XLS 文件(`uploads/`、`xls/`)和 ECharts 源映射文件(`*.map`)不纳入版本控制 + +## 下一步 + +由用户指定。 diff --git a/charts/chartSix.php b/deprecated/chartSix.php similarity index 100% rename from charts/chartSix.php rename to deprecated/chartSix.php diff --git a/charts/chartThree.php b/deprecated/chartThree.php similarity index 100% rename from charts/chartThree.php rename to deprecated/chartThree.php diff --git a/charts/index_ih.php b/deprecated/index_ih.php similarity index 100% rename from charts/index_ih.php rename to deprecated/index_ih.php diff --git a/charts/stock_ih.php b/deprecated/stock_ih.php similarity index 100% rename from charts/stock_ih.php rename to deprecated/stock_ih.php diff --git a/index-2.php b/index-2.php index 0dab173..b030b87 100644 --- a/index-2.php +++ b/index-2.php @@ -102,12 +102,7 @@ 股价VS 北向资金持股--> - - - 股价VS 机构持仓趋势 - - 个股基本面数据 @@ -122,12 +117,7 @@ 指数VS PE/PB/PS/市值 趋势 - - - 指数VS 机构持仓趋势 - - 指数VS 两市总市值 diff --git a/index.php b/index.php index e8edfbc..b60becf 100644 --- a/index.php +++ b/index.php @@ -27,11 +27,9 @@ $_REQUEST['ts_code']=$_REQUEST['ts_code']?$_REQUEST['ts_code']:'600000';
个股:股价VS 股息率
个股:股价VS 融资融券余额
-
个股:股价VS 机构持仓趋势
个股:个股基本面数据
指数:指数VS PE/PB/PS/市值 趋势
-
指数:指数VS 机构持仓趋势
指数:指数VS 两市总市值
指数:指数VS 融资余额