sqlite-web 0.7.2
gitea.db
issue
908 rows, showing page 5
Create
Query
access
access_token
action
action_artifact
action_run
action_run_index
action_run_job
action_runner
action_runner_token
action_schedule
action_schedule_spec
action_task
action_task_output
action_task_step
action_tasks_version
action_variable
app_state
attachment
auth_token
badge
branch
collaboration
comment
commit_status
commit_status_index
commit_status_summary
commit_sync_log
commit_sync_status
dbfs_data
dbfs_meta
deploy_key
email_address
email_hash
external_login_user
follow
gpg_key
gpg_key_import
hook_task
issue
issue_assignees
issue_content_history
issue_dependency
issue_index
issue_label
issue_pin
issue_user
issue_watch
label
language_stat
lfs_lock
lfs_meta_object
login_source
milestone
mirror
notice
notification
oauth2_application
oauth2_authorization_code
oauth2_grant
org_user
package
package_blob
package_blob_upload
package_cleanup_rule
package_file
package_property
package_version
project
project_board
project_issue
protected_branch
protected_tag
public_key
pull_auto_merge
pull_request
push_mirror
reaction
release
renamed_branch
repo_archiver
repo_hidden_file
repo_indexer_status
repo_license
repo_redirect
repo_topic
repo_transfer
repo_unit
repository
review
review_state
secret
session
sqlite_sequence
star
stopwatch
system_setting
task
team
team_invite
team_repo
team_unit
team_user
topic
tracked_time
two_factor
upload
user
user_badge
user_blocking
user_open_id
user_redirect
user_setting
version
watch
webauthn_credential
webhook
Toggle helper tables
Structure
Content
Query
Insert
Drop
Import
Export
Bulk Delete
id
repo_id
index
poster_id
original_author
original_author_id
name
content
milestone_id
priority
is_closed
is_pull
num_comments
ref
deadline_unix
created_unix
updated_unix
closed_unix
is_locked
content_version
time_estimate
719
22
93
1
0
1
0
0
1
1
0
0
1785224329
1785224335
1785224335
0
0
0
Edit
Delete
718
22
92
1
0
1
0
0
1
1
0
0
1785224312
1785224318
1785224318
0
0
0
Edit
Delete
717
23
48
1
0
其他
0
0
1
1
0
0
1785224288
1785224294
1785224294
0
0
0
Edit
Delete
716
23
47
1
0
其他
0
0
1
1
0
0
1785224273
1785224279
1785224279
0
0
0
Edit
Delete
715
21
323
1
0
新用户注册会员bug修复
0
0
1
1
0
0
1785224252
1785224258
1785224258
0
0
0
Edit
Delete
714
21
322
1
0
新用户注册会员bug修复
0
0
1
1
0
0
1785224230
1785224237
1785224237
0
0
0
Edit
Delete
713
18
212
1
0
bug
0
0
1
1
0
0
1785224202
1785224212
1785224212
0
0
0
Edit
Delete
712
18
211
1
0
bug
0
0
1
1
0
0
1785224168
1785224183
1785224183
0
0
0
Edit
Delete
711
23
46
1
0
bug-V2平台调音-1的商家id不显示问题
0
0
1
1
0
0
1784874674
1784874685
1784874685
0
0
0
Edit
Delete
710
23
45
1
0
111
0
0
1
1
0
0
1784874629
1784874643
1784874643
0
0
0
Edit
Delete
709
21
321
1
0
套餐购买页“购买时长"页签根据后台设置显隐
0
0
1
1
0
0
1784871361
1786672696
1784871367
0
0
0
Edit
Delete
708
21
320
1
0
套餐购买页“购买时长"页签根据后台设置显隐
0
0
1
1
0
0
1784871323
1784871331
1784871331
0
0
0
Edit
Delete
707
22
91
1
0
Merge pull request '一些bug' (#90) from app
Merge pull request '一些bug' (#90) from app into app-260728
...
0
0
1
1
0
0
1784871262
1784871267
1784871267
0
0
0
Edit
Delete
706
23
44
1
0
bug-V2平台调音-1的商家id不显示问题
0
0
1
1
0
0
1784802032
1784802046
1784802046
0
0
0
Edit
Delete
705
22
90
1
0
一些bug
0
0
1
1
0
0
1784801871
1784871268
1784801879
0
0
0
Edit
Delete
704
22
89
1
0
一些bug
0
0
1
1
0
0
1784801850
1784801855
1784801855
0
0
0
Edit
Delete
703
21
319
1
0
需求-H5点击下载不跳转
0
0
1
1
0
0
1784772792
1784772800
1784772800
0
0
0
Edit
Delete
702
23
43
1
0
需求 小程序设置导出 16583
0
0
1
1
0
0
1784772728
1784772735
1784772735
0
0
0
Edit
Delete
701
21
318
1
0
需求 续费弹窗语音提醒 16618
0
0
1
1
0
0
1784696808
1784696845
1784696845
0
0
0
Edit
Delete
700
23
42
1
0
需求 小程序设置导出 16583
0
0
1
1
0
0
1784696709
1784696723
1784696723
0
0
0
Edit
Delete
699
18
210
1
0
需求 灯光配置增加中控类型
0
0
1
1
0
0
1784696664
1784696673
1784696673
0
0
0
Edit
Delete
698
22
88
1
0
订台汇总test
0
0
1
1
0
0
1784696635
1784696641
1784696641
0
0
0
Edit
Delete
697
21
317
1
0
预订开房多过滤该包厢上一单已关房的账单时间
0
0
1
1
0
0
1783992006
1783992023
1783992023
0
0
0
Edit
Delete
696
21
316
1
0
需求 暂停屏保 16512
0
0
1
1
0
0
1783991980
1783991987
1783991987
0
0
0
Edit
Delete
695
18
209
1
0
前端打包编译
0
0
1
1
0
0
1783991378
1783991391
1783991391
0
0
0
Edit
Delete
694
18
208
1
0
前端打包编译
0
0
1
1
0
0
1783991348
1783991356
1783991356
0
0
0
Edit
Delete
693
23
41
1
0
1111
0
0
1
1
0
0
1783990894
1783990913
1783990913
0
0
0
Edit
Delete
690
25
4
1
0
需求 时序设备api控制 16449
0
0
1
1
0
0
1783048848
1783048853
1783048853
0
0
0
Edit
Delete
689
18
207
1
0
需求 门店名称限制 16489
0
0
1
1
0
0
1782976300
1782976308
1782976308
0
0
0
Edit
Delete
688
23
40
1
0
新增活动任务配置相关model
0
0
1
1
0
0
1782974732
1782974741
1782974741
0
0
0
Edit
Delete
687
21
315
1
0
预订开房多过滤该包厢上一单已关房的账单时间
0
0
1
1
0
0
1782973124
1782973131
1782973131
0
0
0
Edit
Delete
686
22
87
1
0
需求 门店名称限制 16489
0
0
1
1
0
0
1782720336
1782720353
1782720353
0
0
0
Edit
Delete
685
21
314
1
0
需求 小程序,h5默认灯光 16498
0
0
1
1
0
0
1782720278
1782720287
1782720287
0
0
0
Edit
Delete
684
21
313
1
0
需求 小程序,h5默认灯光 16498
0
0
1
1
0
0
1782720186
1782720207
1782720207
0
0
0
Edit
Delete
683
18
206
1
0
需求 赠时报表 16382
0
0
1
1
0
0
1782698509
1782698569
1782698569
0
0
0
Edit
Delete
682
18
205
1
0
需求 赠时报表 16382
0
0
1
1
0
0
1782698462
1782698472
1782698472
0
0
0
Edit
Delete
681
21
312
1
0
测试
0
0
1
1
0
0
1782698000
1782698023
1782698023
0
0
0
Edit
Delete
680
21
311
1
0
测试
0
0
1
1
0
0
1782697976
1782697982
1782697982
0
0
0
Edit
Delete
679
22
86
1
0
退款用户加手机号显示
0
0
1
1
0
0
1782697413
1782697422
1782697422
0
0
0
Edit
Delete
678
22
85
1
0
退款用户加手机号显示
0
0
1
1
0
0
1782697385
1782697392
1782697392
0
0
0
Edit
Delete
677
23
39
1
0
需求-续费二维码
0
0
1
1
0
0
1782357094
1784802050
1784802050
0
0
0
Edit
Delete
676
23
38
1
0
需求-续费二维码
0
0
1
1
0
0
1782357069
1782357078
1782357078
0
0
0
Edit
Delete
675
21
310
1
0
退款api
0
0
1
1
0
0
1781763061
1781763086
1781763086
0
0
0
Edit
Delete
674
21
309
1
0
111
0
0
1
1
0
0
1781763027
1781763036
1781763036
0
0
0
Edit
Delete
673
32
1
1
0
222
0
0
0
1
0
0
1781158798
1781158798
0
0
0
0
Edit
Delete
672
21
308
1
0
Merge pull request '260519分支分支' (#3) from
Merge pull request '260519分支分支' (#3) from pay into pay-260616
...
0
0
1
1
0
0
1781141923
1781141933
1781141933
0
0
0
Edit
Delete
671
18
204
1
0
Merge pull request '合并0519最新' (#112) from
Merge pull request '合并0519最新' (#112) from pc into pc-260616
...
0
0
1
1
0
0
1781141864
1781141874
1781141874
0
0
0
Edit
Delete
670
23
37
1
0
Merge pull request '0519' (#3) from admin
Merge pull request '0519' (#3) from admin into admin-260616
...
0
0
1
1
0
0
1781141783
1781141791
1781141791
0
0
0
Edit
Delete
669
22
84
1
0
0616合并
0
0
1
1
0
0
1781141689
1781141696
1781141696
0
0
0
Edit
Delete
668
23
36
1
0
🔍 代码审查报告:admin-260616 - 生成小程序码
## 自动代码审查报告 **分支**: admin-260616 **提交**: `d7e82ca
## 自动代码审查报告 **分支**: admin-260616 **提交**: `d7e82ca5e26517b2e5ceaef844232aa1a7546ef4` **提交人**: LITTLEMAIDI (11833999+littlemaidi@user.noreply.gitee.com) **时间**: 2026-06-10 18:14:17 --- ## 1. 审查摘要 - **代码质量评分**:6.5 / 10 分 - **总体评价**:业务意图清晰,核心流程(生成、缓存、返回小程序码)已实现。但存在明显的逻辑隐患(二进制流与 JSON 混处理)、性能瓶颈(重复加载模型、日志记录不当)及框架规范偏离。缺乏必要的异常处理与并发控制,需重点修复。 - **风险等级**:中(存在脏数据写入、日志膨胀及潜在运行时警告风险) > 📌 **框架说明**:提供的目录结构与代码风格高度吻合 **CodeIgniter 3**。若 `phpci` 为内部定制框架且继承自 CI3,以下建议完全适用;若为独立架构,请根据实际生命周期调整依赖加载方式。 ## 2. 问题详情 | 严重程度 | 文件/行号 | 问题描述 | 建议修改方案 | 代码示例 (可选) | | :--- | :--- | :--- | :--- | :--- | | 🔴 严重 | `create_qrcode()` 方法 | 微信 `getUnlimited` 接口成功时返回**二进制图片流**,失败时返回 JSON。代码直接对返回值执行 `json_decode`,成功时返回 `null` 导致逻辑“侥幸”通过;且 `var_export` 记录二进制数据会导致日志文件暴增,甚至触发内存溢出。 | 先判断返回值是否为 JSON 格式(或检查 HTTP 状态/错误码),成功则直接上传,失败才解析并记录日志。避免对二进制数据执行序列化。 | `if (str_starts_with(trim($wxacode), '{')) { $err = json_decode($wxacode, true); if (isset($err['errcode']) && $err['errcode'] > 0) { do_log(...); return ''; } }` | | 🔴 严重 | `get_qrcode()` 方法 | `$merchant_data['_business_model']` 未做空值校验。若商家不存在或查询返回空数组,将触发 `Undefined index` 警告,并可能绕过业务模型校验直接生成码。 | 增加 `empty()` 或 `isset()` 防御性判断,确保数据结构完整后再访问字段。 | `if (empty($merchant_data) || $merchant_data['_business_model'] != self::BUSINESS_MODEL_SELF_SERVICE) { return ''; }` | | 🟠 警告 | 文件顶部 (1-3行) | 全局作用域使用 `$CI = &get_instance();` 违反 MVC 模型规范。在 CI/类 CI 框架中,模型文件被 `include` 时即执行,易引发作用域污染、重复实例化及内存泄漏。 | 移除顶部全局赋值,依赖加载应移至类构造函数或使用 `$this->load`。 | 删除顶部两行,在 `__construct()` 中调用 `$this->load->model('Simple_model');`(若父类未自动加载) | | 🟠 警告 | `update_qrcode()` 方法 | 存在**并发竞态条件**。高并发下多个请求可能同时通过 `empty($data['_qrcode'])` 检查,导致重复调用微信接口、重复上传 OSS 及数据库重复插入/覆盖。 | 数据库 `_family_server_id` 字段添加唯一索引,代码改用原子操作(如 `INSERT ... ON DUPLICATE KEY UPDATE` 或框架 `upsert`)。 | `$this->db->set($insert)->where($where)->on_duplicate_key_update(['_qrcode' => $qrcode])->insert();` | | 🟠 警告 | `create_qrcode()` 方法 | 阿里云 OSS 上传 `alioss_internal_addObject_by_content` 未做返回值校验或异常捕获。若上传失败,仍会拼接 URL 写入数据库,产生大量无效脏数据。 | 增加上传结果校验,失败时记录明确日志并中断流程,避免写入无效路径。 | `if (!alioss_internal_addObject_by_content($file_url, $buffer)) { do_log('OSS upload failed', 'qrcode_error'); return ''; }` | | 🟡 建议 | 全局/类定义 | 类名 `Ahead_room_renewal_mini_qrcode_model` 使用蛇形命名,不符合 PSR-12 规范;魔法数字 `2` 硬编码;`$room_data` 数组键未做类型/存在性校验。 | 类名改为大驼峰 `AheadRoomRenewalMiniQrcodeModel`;提取业务模型常量;增加输入参数校验。 | `class AheadRoomRenewalMiniQrcodeModel extends Simple_model { const BUSINESS_MODEL_SELF_SERVICE = 2; ... }` | | 🟡 建议 | `get_qrcode()` 方法 | 方法内部动态加载 `$this->load->model('ahead_yc_merchant_model')`,每次调用都会触发框架加载器解析,增加不必要的 I/O 开销。 | 移至构造函数中统一加载,提升执行效率。 | `public function __construct() { parent::__construct(); $this->load->model('ahead_yc_merchant_model'); }` | | 🟡 建议 | `create_qrcode()` 方法 | 硬编码 OSS 域名 `https://vodonline.g-hi.com/` 及路径拼接逻辑,不利于多环境(测试/生产)切换;`DEBUG_VERSION` 若未严格过滤可能存在路径穿越隐患。 | 将域名与基础路径抽离至配置文件,使用框架配置函数读取。 | `$oss_domain = config_item('oss_public_domain'); $file_url = rtrim($oss_domain, '/') . '/' . $path;` | ## 3. 总结与行动建议 ### 🔑 优先修复的关键问题 1. **修复微信接口返回值处理逻辑**:严格区分二进制流与 JSON 错误响应,移除对二进制数据的 `json_decode` 和 `var_export`,防止日志爆炸与误判。 2. **增加空值防御与上传校验**:在 `get_qrcode` 中校验 `$merchant_data` 是否存在;在 `create_qrcode` 中校验 OSS 上传结果,失败时阻断数据库写入。 3. **消除全局 `$CI` 实例化**:移除文件顶部的 `get_instance()`,遵循框架模型生命周期规范,避免隐式内存泄漏。 ### 🛠 后续重构与优化方向 - **并发安全设计**:为 `ahead_room_renewal_mini_qrcode` 表的 `_family_server_id` 添加唯一索引,将 `get_one` + `insert/update` 替换为数据库层面的 `UPSERT` 操作,彻底解决竞态条件。 - **依赖注入与配置化**:将硬编码的常量、域名、业务模型阈值抽离至 `config/` 目录;考虑使用构造函数注入依赖模型,提升单元测试友好度。 - **日志规范化**:使用结构化日志(如 JSON 格式)替代 `var_export`,仅记录关键标识符与错误码,避免敏感数据或二进制内容污染日志系统。 - **输入校验层**:在 Controller 层或 Model 入口处对 `$room_data` 进行类型断言与必填字段校验(如 `_id`, `_merchant_id` 必须为整型),防止脏数据流入核心逻辑。 > 💡 **提示**:若 `phpci` 框架对模型加载、数据库操作有特定封装(如内置 `upsert` 或统一响应对象),请优先查阅官方文档替换原生 SQL/CI 写法,以保持架构一致性。 --- *此 Issue 由代码审查服务自动创建*
...
0
0
0
0
0
0
1781086457
1781086457
0
0
0
0
Edit
Delete
«
‹
Page 5 / 19
›
»