更新保证金

This commit is contained in:
yaooo 2023-09-26 16:25:30 +08:00
parent c653d80759
commit 7cbeceb860

View File

@ -268,12 +268,15 @@ class Merchant extends BaseController
if(empty($merchantInfo)){ if(empty($merchantInfo)){
return app('json')->fail('参数错误'); return app('json')->fail('参数错误');
} }
$merchantInfo['unpaid_margin'] = $merchantInfo['margin'];
$merchantTypeInfo = Db::name('merchant_type')->where('mer_type_id', $merchantInfo['type_id'])->find(); $merchantTypeInfo = Db::name('merchant_type')->where('mer_type_id', $merchantInfo['type_id'])->find();
if ($merchantTypeInfo['first_margin'] > 0) { if ($merchantTypeInfo['first_margin'] > 0) {
if ($merchantInfo['first_margin_status']) { if ($merchantInfo['first_margin_status']) {
$merchantInfo['margin'] = bcsub($merchantInfo['margin'], $merchantTypeInfo['first_margin'], 2); $merchantInfo['margin'] = bcsub($merchantInfo['margin'], $merchantTypeInfo['first_margin'], 2);
$merchantInfo['unpaid_margin'] = $merchantInfo['margin'];
} else { } else {
$merchantInfo['margin'] = $merchantTypeInfo['first_margin']; $merchantInfo['margin'] = $merchantTypeInfo['first_margin'];
$merchantInfo['unpaid_margin'] = $merchantTypeInfo['margin'];
} }
} }
return app('json')->success($merchantInfo); return app('json')->success($merchantInfo);