直接SQL插入测试

步骤1:连接数据库

✓ 数据库连接成功

步骤2:检查表fa_promotion_demands

✓ 表fa_promotion_demands存在

CREATE TABLE `fa_promotion_demands` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `project_name` varchar(100) NOT NULL COMMENT '项目名称',
  `project_brand` varchar(255) DEFAULT NULL COMMENT '宣传品牌',
  `is_brand_confidential` tinyint(1) DEFAULT '0' COMMENT '品牌是否对外保密',
  `project_desc` text COMMENT '项目描述',
  `demand_desc` text COMMENT '需求描述',
  `project_detail` text COMMENT '项目详情',
  `status` enum('待审核','招募中','已截止报名','项目已执行完成') DEFAULT '待审核' COMMENT '项目状态',
  `synced_to_admin` tinyint(1) DEFAULT '0' COMMENT '是否已同步到后台',
  `sync_time` int(11) DEFAULT NULL COMMENT '同步时间',
  `feedback` text COMMENT '反馈意见',
  `publish_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '需求发布日期',
  `deadline_date` datetime NOT NULL COMMENT '需求截止日期',
  `execution_start_date` date NOT NULL COMMENT '需求执行开始日期',
  `execution_end_date` date NOT NULL COMMENT '需求执行结束日期',
  `total_budget` decimal(10,2) DEFAULT NULL COMMENT '需求总预算',
  `view_count` int(11) NOT NULL DEFAULT '0' COMMENT '查看次数',
  `applicant_count` int(11) NOT NULL DEFAULT '0' COMMENT '报名总数',
  `influencer_count` int(11) NOT NULL DEFAULT '0' COMMENT '达人报名数',
  `institution_count` int(11) NOT NULL DEFAULT '0' COMMENT '机构报名数',
  `detail_requirement` text COMMENT '项目详细需求',
  `creator_id` int(11) NOT NULL COMMENT '创建者ID',
  `creator_type` enum('admin','user') NOT NULL COMMENT '创建者类型',
  `created_at` int(11) DEFAULT NULL COMMENT '创建时间',
  `updated_at` int(11) DEFAULT NULL COMMENT '更新时间',
  `platform_type` text COMMENT '平台类型(国内平台,国际平台,网络媒体,本地推广)',
  `platform_list` text COMMENT '具体平台列表(JSON格式)',
  `platform_fields` text COMMENT '平台相关字段JSON数据',
  `influencer_fans_min` int(11) DEFAULT NULL COMMENT '达人粉丝最低数量',
  `influencer_fans_max` int(11) DEFAULT NULL COMMENT '达人粉丝最高数量',
  `influencer_required_count` int(11) DEFAULT NULL COMMENT '所需达人数量',
  `cooperation_element` varchar(50) DEFAULT NULL COMMENT '合作元素(图文、视频、图文+视频)',
  `cooperation_form` varchar(255) DEFAULT NULL COMMENT '合作形式(寄拍原创、送拍原创、看图原创、直发、探店等)',
  `promotion_form` varchar(50) DEFAULT NULL COMMENT '推广形式(走平台、不走平台)',
  `influencer_budget` decimal(10,2) DEFAULT NULL COMMENT '单个达人预算',
  `influencer_region` varchar(255) DEFAULT NULL COMMENT '达人地区要求',
  `influencer_gender` varchar(20) DEFAULT NULL COMMENT '达人性别(男、女、不限)',
  `influencer_type` text COMMENT '达人类型(JSON格式存储多选项)',
  `international_location` varchar(255) DEFAULT NULL COMMENT '达人属地',
  `media_types` text COMMENT '所需媒体类型(JSON格式存储多选项)',
  `has_draft` varchar(20) DEFAULT NULL COMMENT '是否已经有稿件(已有、需要撰写)',
  `media_count` int(11) DEFAULT NULL COMMENT '需要传播媒体数量',
  `inclusion_requirement` int(11) DEFAULT NULL COMMENT '收录要求百分比',
  `activity_budget` decimal(10,2) DEFAULT NULL COMMENT '活动预算',
  `media_platforms` text COMMENT '所需媒体平台(JSON格式存储多选项)',
  `activity_location` varchar(255) DEFAULT NULL COMMENT '活动地点',
  `activity_organizer` varchar(255) DEFAULT NULL COMMENT '活动主办方',
  `activity_time` datetime DEFAULT NULL COMMENT '活动时间',
  `invited_media_list` text COMMENT '预邀约媒体名单',
  `single_media_budget` decimal(10,2) DEFAULT NULL COMMENT '单个媒体预算',
  `media_requirements` text COMMENT '要求媒体(到现场、撰稿、发布、专访等,JSON格式存储)',
  `project_attachments` text COMMENT '项目附件(JSON格式存储文件路径)',
  `activity_details_file` varchar(255) DEFAULT NULL COMMENT '活动详情文件',
  `reference_accounts` text COMMENT '示例达人账号(JSON格式存储多个账号链接)',
  `cooperation_remarks` text COMMENT '合作备注',
  `status_updates` text COMMENT '状态历史',
  PRIMARY KEY (`id`),
  KEY `idx_synced_to_admin` (`synced_to_admin`)
) ENGINE=InnoDB AUTO_INCREMENT=156 DEFAULT CHARSET=utf8mb4 COMMENT='推广需求主表'

步骤3:测试INSERT权限和执行

将执行以下SQL:

INSERT INTO `fa_promotion_demands` 
            (`project_name`, `project_detail`, `publish_date`, `deadline_date`, 
             `execution_start_date`, `execution_end_date`, `status`, 
             `creator_id`, `creator_type`, `created_at`, `updated_at`) 
            VALUES 
            ('测试项目名称-20260609124845', '这是通过direct_insert.php插入的测试记录', '2026-06-09 12:48:45', '2026-07-09 12:48:45', 
             '2026-06-11', '2026-07-04', '待审核',
             1, 'user', 1780980525, 1780980525)

✓ 数据插入成功! 新记录ID: 156

✓ 成功读取刚插入的数据

插入的记录内容:

id156
project_name测试项目名称-20260609124845
project_brand
is_brand_confidential0
project_desc
demand_desc
project_detail这是通过direct_insert.php插入的测试记录
status待审核
synced_to_admin0
sync_time
feedback
publish_date2026-06-09 12:48:45
deadline_date2026-07-09 12:48:45
execution_start_date2026-06-11
execution_end_date2026-07-04
total_budget
view_count0
applicant_count0
influencer_count0
institution_count0
detail_requirement
creator_id1
creator_typeuser
created_at1780980525
updated_at1780980525
platform_type
platform_list
platform_fields
influencer_fans_min
influencer_fans_max
influencer_required_count
cooperation_element
cooperation_form
promotion_form
influencer_budget
influencer_region
influencer_gender
influencer_type
international_location
media_types
has_draft
media_count
inclusion_requirement
activity_budget
media_platforms
activity_location
activity_organizer
activity_time
invited_media_list
single_media_budget
media_requirements
project_attachments
activity_details_file
reference_accounts
cooperation_remarks
status_updates

步骤4:检查表中现有数据

表中现有记录数: 65

最近5条记录:

ID项目名称状态发布日期
156测试项目名称-20260609124845待审核2026-06-09 12:48:45
155测试项目名称-20260219052806待审核2026-02-19 05:28:06
154测试项目-20251125122915待审核2025-11-25 12:29:15
153测试项目名称-20251125122912待审核2025-11-25 12:29:12
152测试项目名称-20250601093704待审核2025-06-01 09:37:04

数据库连接已关闭

返回极简表单