更新保证金支付

This commit is contained in:
yaooo 2023-09-27 10:22:09 +08:00
parent e90f80f3e1
commit 86d76c5c2b
7 changed files with 12 additions and 19 deletions

View File

@ -190,7 +190,7 @@ class Merchant extends BaseController
*/
public function checkParam(MerchantValidate $validate, $isUpdate = false)
{
$data = $this->request->params([['area_id',0],['street_id',0],['village_id',0],['category_id', 0], ['type_id', 0], 'mer_name', 'commission_rate', 'real_name', 'mer_phone', 'mer_keyword', 'mer_address', 'mark', ['sort', 0], ['status', 0], ['is_audit', 0], ['is_best', 0], ['is_bro_goods', 0], ['is_bro_room', 0], ['is_trader', 0],'sub_mchid', 'auto_margin_rate', 'paid_margin']);
$data = $this->request->params([['area_id',0],['street_id',0],['village_id',0],['category_id', 0], ['type_id', 0], 'mer_name', 'commission_rate', 'real_name', 'mer_phone', 'mer_keyword', 'mer_address', 'mark', ['sort', 0], ['status', 0], ['is_audit', 0], ['is_best', 0], ['is_bro_goods', 0], ['is_bro_room', 0], ['is_trader', 0],'sub_mchid', 'auto_margin_rate', 'paid_margin', 'first_margin']);
if (!$isUpdate) {
$data += $this->request->params(['mer_account', 'mer_password']);
}else {

View File

@ -280,13 +280,9 @@ 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'] = $merchantTypeInfo['first_margin'];
}
if ($merchant['first_margin'] > 0 && $merchant['first_margin_status'] == 0) {
$merchant['margin'] = $merchant['first_margin'];
}
$repository = app()->make(StoreOrderRepository::class);
$orderSn = "bzj" . date('YmdHis') . uniqid();
Db::name('margin_order')->insert([

View File

@ -264,18 +264,15 @@ class Merchant extends BaseController
if(empty($id)){
return app('json')->fail('参数不能为空');
}
$merchantInfo = Db::name('merchant')->where('mer_id',$id)->field('uid,mer_id,type_id,mer_name,margin,paid_margin,is_margin,first_margin_status')->find();
$merchantInfo = Db::name('merchant')->where('mer_id',$id)->field('uid,mer_id,type_id,mer_name,margin,paid_margin,is_margin,first_margin,first_margin_status')->find();
if(empty($merchantInfo)){
return app('json')->fail('参数错误');
}
$merchantInfo['unpaid_margin'] = $merchantInfo['margin'];
$merchantTypeInfo = Db::name('merchant_type')->where('mer_type_id', $merchantInfo['type_id'])->find();
if ($merchantTypeInfo['first_margin'] > 0) {
if ($merchantInfo['first_margin_status']) {
$merchantInfo['margin'] = $merchantInfo['margin'];
} else {
$merchantInfo['margin'] = $merchantTypeInfo['first_margin'];
}
if ($merchant['first_margin'] > 0 && $merchant['first_margin_status'] == 0) {
$merchantInfo['margin'] = $merchantInfo['first_margin'];
} else {
$merchantInfo['margin'] = $merchantTypeInfo['margin'];
}
return app('json')->success($merchantInfo);
}

View File

@ -31,9 +31,9 @@ class paySuccessMargin
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
'margin' => $marginAmount
]);
$merchantTypeInfo = Db::name('merchant_type')->where('mer_type_id', $merchantInfo['type_id'])->find();
if ($merchantTypeInfo['first_margin'] > 0) {
if (!$merchantInfo['first_margin_status'] && ($marginInfo['total_price'] <= $merchantTypeInfo['first_margin'])) {
if ($merchantInfo['first_margin'] > 0 && $merchantInfo['first_margin_status'] == 0) {
if ($marginInfo['total_price'] <= $merchantTypeInfo['first_margin']) {
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'] ?? 0)->where('uid', $marginInfo['uid'] ?? 0)->update([
'first_margin_status' => 1
]);

View File

@ -2,4 +2,4 @@
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
if(window.location.protocol == 'https:'){
document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">')
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.cd02d553.js></script></body></html>
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.7f0cc918.js></script></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB