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