diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index ea1789ef..d5cd50c0 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -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([