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>
This commit is contained in:
@@ -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/` 目录中的文件已排除,不纳入统计
|
||||||
+34
-20
@@ -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/ 等)
|
|
||||||
|
|
||||||
### 图表标准化
|
1. **CLAUDE.md 更新**
|
||||||
- 5 个旧模式页面已转换为 `index_margin.php` 模式(fetch + loading overlay + 提交按钮)
|
- 补充缺失页面:`chartSix.php`、`chartThree.php`
|
||||||
- `moneyflow.php`、`realestate.php`、`estateTradeDaily.php`、`estateListDaily.php`、`estateNewTradeDaily.php`
|
- 新增数据获取模式说明(传统 PHP 注入 vs JS fetch 调用外部 API)
|
||||||
- 新增 2 个 AJAX 端点(`moneyflowData`、`estateData`)
|
- 新增 `quant/`、`api_document/` 子模块文档
|
||||||
- 2 个死 JS 文件移至 deprecated(`chartmoneyflow.js`、`estate.js`)
|
- 新增常用命令(php -l、composer、sync-echart)
|
||||||
- 8 个页面已在标准模式下,无需改动
|
- 合并 AGENTS.md 代码风格约定
|
||||||
|
|
||||||
### 项目结构澄清
|
2. **Git 仓库连接与推送**
|
||||||
- iframe 嵌入页(chartSix、chartStDetail、chartThree)保持原样——它们通过 URL 参数接收数据、查询本地 DB
|
- 初始化 git 仓库,连接 `https://github.com/Simon2046/echarts`
|
||||||
- 非图表页(stockkeydata、stockTradeRecord、myexcel)保持原样
|
- 合并本地较新代码到远程 main 分支
|
||||||
|
- 提交 eedead0,228 个文件变更
|
||||||
|
- `.gitignore` 新增排除规则:`.mcp.json`、`.serena/`、`uploads/`、`xls/`、`*.map`
|
||||||
|
|
||||||
## 后续步骤
|
3. **数据库表清单整理**
|
||||||
1. 浏览器验证转换后的页面:moneyflow、realestate、estate 系列
|
- 扫描全项目,识别出 16 张 MySQL 表
|
||||||
2. 后续可考虑将 iframe 页面的本地 DB 查询也改为 fetch + AJAX 端点模式
|
- 发现 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`)不纳入版本控制
|
||||||
|
|
||||||
|
## 下一步
|
||||||
|
|
||||||
|
由用户指定。
|
||||||
|
|||||||
+2
-12
@@ -102,12 +102,7 @@
|
|||||||
<i class="fa-solid fa-globe-asia text-blue-500 w-6"></i>
|
<i class="fa-solid fa-globe-asia text-blue-500 w-6"></i>
|
||||||
<span>股价VS 北向资金持股</span>-->
|
<span>股价VS 北向资金持股</span>-->
|
||||||
</a>
|
</a>
|
||||||
<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stock_ih.php');"
|
<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stockkeydata.php');"
|
||||||
class="flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-all">
|
|
||||||
<i class="fa-solid fa-building-columns text-purple-500 w-6"></i>
|
|
||||||
<span>股价VS 机构持仓趋势</span>
|
|
||||||
</a>
|
|
||||||
<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stockkeydata.php');"
|
|
||||||
class="flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-all">
|
class="flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-all">
|
||||||
<i class="fa-solid fa-table text-yellow-500 w-6"></i>
|
<i class="fa-solid fa-table text-yellow-500 w-6"></i>
|
||||||
<span>个股基本面数据</span>
|
<span>个股基本面数据</span>
|
||||||
@@ -122,12 +117,7 @@
|
|||||||
<i class="fa-solid fa-chart-area text-indigo-500 w-6"></i>
|
<i class="fa-solid fa-chart-area text-indigo-500 w-6"></i>
|
||||||
<span>指数VS PE/PB/PS/市值 趋势</span>
|
<span>指数VS PE/PB/PS/市值 趋势</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_ih.php');"
|
<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_mv_all.php');"
|
||||||
class="flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-all">
|
|
||||||
<i class="fa-solid fa-institution text-teal-500 w-6"></i>
|
|
||||||
<span>指数VS 机构持仓趋势</span>
|
|
||||||
</a>
|
|
||||||
<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_mv_all.php');"
|
|
||||||
class="flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-all">
|
class="flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition-all">
|
||||||
<i class="fa-solid fa-chart-pie text-orange-500 w-6"></i>
|
<i class="fa-solid fa-chart-pie text-orange-500 w-6"></i>
|
||||||
<span>指数VS 两市总市值</span>
|
<span>指数VS 两市总市值</span>
|
||||||
|
|||||||
@@ -27,11 +27,9 @@ $_REQUEST['ts_code']=$_REQUEST['ts_code']?$_REQUEST['ts_code']:'600000';
|
|||||||
<div class="div_block">个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stockdiv.php');">股价VS 股息率</a></div>
|
<div class="div_block">个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stockdiv.php');">股价VS 股息率</a></div>
|
||||||
<div class="div_block">个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stockmargin.php');">股价VS 融资融券余额</a></div>
|
<div class="div_block">个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stockmargin.php');">股价VS 融资融券余额</a></div>
|
||||||
<!--<div class="div_block">个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/hkholdbycode.php');">股价VS 北向资金持股</a></div>-->
|
<!--<div class="div_block">个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/hkholdbycode.php');">股价VS 北向资金持股</a></div>-->
|
||||||
<div class='div_block'>个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stock_ih.php');">股价VS 机构持仓趋势</a></div>
|
|
||||||
<div class='div_block'>个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stockkeydata.php');">个股基本面数据</a></div>
|
<div class='div_block'>个股:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/stockkeydata.php');">个股基本面数据</a></div>
|
||||||
<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_trend.php');">指数VS PE/PB/PS/市值 趋势</a>
|
<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_trend.php');">指数VS PE/PB/PS/市值 趋势</a>
|
||||||
</div>
|
</div>
|
||||||
<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_ih.php');">指数VS 机构持仓趋势</a></div>
|
|
||||||
<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_mv_all.php');">指数VS 两市总市值</a></div>
|
<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_mv_all.php');">指数VS 两市总市值</a></div>
|
||||||
<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_margin.php');">指数VS 融资余额</a></div>
|
<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/charts/index_margin.php');">指数VS 融资余额</a></div>
|
||||||
<!--<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/moneyflow.php');">指数VS 沪深港通资金流向</a></div> -->
|
<!--<div class='div_block'>指数:<a href="#" onclick="openurl('https://echart.doorcome.cn/moneyflow.php');">指数VS 沪深港通资金流向</a></div> -->
|
||||||
|
|||||||
Reference in New Issue
Block a user