修复创建项目500错误:code列名改为project_code

This commit is contained in:
a273825743
2026-05-17 01:10:24 +08:00
parent 27cdfc03c6
commit 86a4cc65ee
+1 -1
View File
@@ -368,7 +368,7 @@ router.post('/', async (req, res) => {
String(Math.floor(Math.random() * 10000)).padStart(4, '0');
const result = await db.query(
`INSERT INTO projects (name, code, customer_id, project_manager_id, contract_amount, start_date, end_date, description, status, location, type_template_id, created_at, updated_at)
`INSERT INTO projects (name, project_code, customer_id, project_manager_id, contract_amount, start_date, end_date, description, status, location, type_template_id, created_at, updated_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
RETURNING id`,
[name, projectCode, customer_id || null, manager_id || null, contract_amount || 0, start_date || '', end_date || '', description || '', status || 'planning', location || '', type_template_id || null]