1292 Incorrect datetime value: 'NULL' for column 'news_end_date' at row 1 in: [insert into box_news (news_start_date, news_end_date, news_added_date, news_status) values ('2026-10-12 00:00:00', 'NULL', now(), '0')] If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

出错原因

  1. 结束日期使用了字符串 'NULL'
  2. 日期校验与空值处理不一致
  3. 新增文章时没有处理 news_image 字段
  4. 数据库处于严格模式

修复方式
生效日期 新增文章时,默认当天
结束日期 新增文章时,默认 2099-12-31
日期比较 使用实际日期值进行比较,不再依赖字符串 'NULL'
封面图片 新建文章时允许暂时为空,后续通过原有封面管理功能设置
数据库写入 让 PHP 插入的数据与数据库字段约束一致

替换文件到AdminPath下
news_box_manager.zip