修复编辑产品推广范围bug

This commit is contained in:
lcc
2025-09-09 17:55:20 +08:00
parent e980dcadbc
commit 7f4f2396c1
@@ -22,9 +22,15 @@ class Auto_product_city_model extends HD_Model
$cityIds = [];
foreach ($citys as $item) {
$cityIds[] = $item[1];
$replace_batch[] = [
'productId' => $productId,
'provinceId' => $item[0],
'cityId' => $item[1],
];
}
$cityIdString = implode(',', $cityIds);
$cityIdString && $this->delete(['productId' => $productId, "cityId not in ($cityIdString)" => null]);
is_array($replace_batch) && $this->replace_batch($replace_batch);
} else {
$this->delete(['productId' => $productId]);
}