【发布时间】:2015-03-25 02:52:01
【问题描述】:
您好,更新函数有问题,它说updated_at 列不明确,确实如此。如何将 updated_at 设置为 product.updated_at。我的错误。
我的更新要求: $product->attributes()->wherePivot('id', $attribute['id'])->update($input);
我的错误:
SQLSTATE [23000]:完整性约束违规:1052 字段列表中的列“updated_at”不明确(SQL:更新attributes 内连接attribute_product on attributes.id = attribute_product.attribute_id 设置@987654327 @ = 测试, model = , attribute_product.name = 颜色, unitprice = 10.00, sellprice = 20.00, discount = 0, active = 0, ordering = 1, 987654336@ = 2015-03-25 02:44:01 其中attribute_product.product_id = 1 和attribute_product.id = 1)
【问题讨论】: