修复编辑产品推广范围bug
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user