|
|
@@ -28,10 +28,11 @@ class BalanceChangeController extends Controller
|
|
|
$shopId = $shop['id'] ?? 0;
|
|
|
$mainId = $shop['mainId'] ?? 0;
|
|
|
$list = CustomClass::getAllByCondition(['ownMainId' => $mainId], null, '*', 'id');
|
|
|
- $ids = array_keys($list);
|
|
|
- if (!empty($ids)) {
|
|
|
- foreach ($ids as $customId) {
|
|
|
- CustomDebtChangeClass::updateByCondition(['customId' => $customId], ['shopId' => $shopId]);
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $custom) {
|
|
|
+ $customId = $custom['id'] ?? 0;
|
|
|
+ $customName = $custom['name'] ?? '';
|
|
|
+ CustomDebtChangeClass::updateByCondition(['customId' => $customId], ['shopId' => $shopId, 'customName' => $customName]);
|
|
|
}
|
|
|
}
|
|
|
}
|