|
|
@@ -93,10 +93,10 @@ class CustomController extends BaseController
|
|
|
$custom['avatar'] = imgUtil::groupImg($custom['avatar']);
|
|
|
|
|
|
//客户欠款额度设置
|
|
|
- if (isset($post['debtLimit']) && is_numeric($post['debtLimit'])) {
|
|
|
- $customId = $custom['id'] ?? 0;
|
|
|
- CustomClass::updateById($customId, ['debtLimit' => $post['debtLimit']]);
|
|
|
- }
|
|
|
+ $debt = isset($post['debt']) && $post['debt'] == CustomClass::IS_DEBT_YES ? CustomClass::IS_DEBT_YES : CustomClass::IS_DEBT_NO;
|
|
|
+ $customId = $custom['id'] ?? 0;
|
|
|
+ $debtLimit = isset($post['debtLimit']) && is_numeric($post['debtLimit']) ? $post['debtLimit'] : 5000;
|
|
|
+ CustomClass::updateById($customId, ['debtLimit' => $debtLimit, 'debt' => $debt]);
|
|
|
|
|
|
$transaction->commit();
|
|
|
util::success($custom);
|