refactor: 修改tco产品数据同步
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 5s
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 5s
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user