更新支付保证金

This commit is contained in:
yaooo 2023-09-26 17:38:04 +08:00
parent a86527c82e
commit bd894ee4c8

View File

@ -280,6 +280,15 @@ class Auth extends BaseController
if (!$merchant) {
return app('json')->fail('用户店铺异常');
}
$merchantTypeInfo = Db::name('merchant_type')->where('mer_type_id', $merchant['type_id'])->find();
if ($merchantTypeInfo['first_margin'] > 0) {
if ($merchant['first_margin_status']) {
$merchant['margin'] = bcsub($merchant['margin'], $merchantTypeInfo['first_margin'], 2);
} else {
$merchant['margin'] = $merchantTypeInfo['first_margin'];
}
}
$repository = app()->make(StoreOrderRepository::class);
$orderSn = "bzj" . date('YmdHis') . uniqid();
Db::name('margin_order')->insert([