refactor: 修改tco产品数据同步
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 5s

This commit is contained in:
2026-01-13 17:30:56 +08:00
parent 5736d09dbe
commit 61728434d3

View File

@@ -201,15 +201,16 @@ class ReceiveProductSync
throw new \Exception('产品创建失败');
}
}
else if (strtotime($product['updated_at']) < strtotime($data['created_at'])) {
$product->spu = $data['spu'];
$product->name = $data['name'];
$product->category_id = $product_category['id'];
$product->status = Operate_Of_ReceiveSync::Disable == $data['operate'] ? -1 : 1;
if (!$product->save()) {
throw new \Exception('产品更新失败');
}
}
// 注释更新同步防止tco同步修改官网手动调整数据
// else if (strtotime($product['updated_at']) < strtotime($data['created_at'])) {
// $product->spu = $data['spu'];
// $product->name = $data['name'];
// $product->category_id = $product_category['id'];
// $product->status = Operate_Of_ReceiveSync::Disable == $data['operate'] ? -1 : 1;
// if (!$product->save()) {
// throw new \Exception('产品更新失败');
// }
// }
} catch (\Throwable $th) {
return error(sprintf('%s %s:%d', $th->getMessage(), $th->getFile(), $th->getLine()));
}