保证金改押金

This commit is contained in:
mkm 2023-10-26 15:08:25 +08:00
parent e12c0aa066
commit 4585d22a50
24 changed files with 68 additions and 68 deletions

View File

@ -55,7 +55,7 @@ class MerchantTypeDao extends BaseDao
[ [
'type' => 'div', 'type' => 'div',
'children' => [ 'children' => [
'保证金:' . $item['margin']. ' 元' '金:' . $item['margin']. ' 元'
], ],
'style' => [ 'style' => [
'paddingTop' => '100px', 'paddingTop' => '100px',

View File

@ -375,7 +375,7 @@ class StoreOrderRepository extends BaseRepository
'financial_record_sn' => $financeSn . ($i++) 'financial_record_sn' => $financeSn . ($i++)
]; ];
} }
//保证金计算 //金计算
if ($_payPrice > 0) { if ($_payPrice > 0) {
/** @var MerchantRepository $merchantRepo */ /** @var MerchantRepository $merchantRepo */
$merchantRepo = app()->make(MerchantRepository::class); $merchantRepo = app()->make(MerchantRepository::class);

View File

@ -318,7 +318,7 @@ class FinancialRepository extends BaseRepository
if ($res['is_margin'] == -1) throw new ValidateException('请勿重复申请'); if ($res['is_margin'] == -1) throw new ValidateException('请勿重复申请');
if (!in_array($res['is_margin'],[10,-10]) || $res['paid_margin'] <= 0) if (!in_array($res['is_margin'],[10,-10]) || $res['paid_margin'] <= 0)
throw new ValidateException('无可退保证金'); throw new ValidateException('无可退金');
$order = app()->make(ServeOrderRepository::class)->getWhere([ $order = app()->make(ServeOrderRepository::class)->getWhere([
'mer_id' => $res['mer_id'], 'mer_id' => $res['mer_id'],
@ -327,7 +327,7 @@ class FinancialRepository extends BaseRepository
]); ]);
if (!$order) throw new ValidateException('未查询到支付订单'); if (!$order) throw new ValidateException('未查询到支付订单');
$financial_account = [ $financial_account = [
'name' => '保证金退款', 'name' => '金退款',
'order_id' => $order['order_id'], 'order_id' => $order['order_id'],
'order_sn' => $order['order_sn'], 'order_sn' => $order['order_sn'],
'pay_price'=> $order['pay_price'], 'pay_price'=> $order['pay_price'],
@ -471,7 +471,7 @@ class FinancialRepository extends BaseRepository
Elm::input('mer_name','商户名称', $data['merchant']->mer_name)->disabled(true), Elm::input('mer_name','商户名称', $data['merchant']->mer_name)->disabled(true),
Elm::input('mer_id','商户ID', $data['mer_id'])->disabled(true), Elm::input('mer_id','商户ID', $data['mer_id'])->disabled(true),
Elm::input('type_name','店铺类型', $data['merchant']->merchantType->type_name)->disabled(true), Elm::input('type_name','店铺类型', $data['merchant']->merchantType->type_name)->disabled(true),
Elm::input('pay_price','保证金额度', $data['merchant']->marginOrder->pay_price)->disabled(true), Elm::input('pay_price','金额度', $data['merchant']->marginOrder->pay_price)->disabled(true),
Elm::input('sub','扣费金额', bcsub($data['merchant']->marginOrder->pay_price, $data['extract_money'], 2))->disabled(true), Elm::input('sub','扣费金额', bcsub($data['merchant']->marginOrder->pay_price, $data['extract_money'], 2))->disabled(true),
Elm::input('refund','退回金额', $data['extract_money'])->disabled(true), Elm::input('refund','退回金额', $data['extract_money'])->disabled(true),
Elm::radio('status', '审核', -1)->setOptions([ Elm::radio('status', '审核', -1)->setOptions([
@ -485,7 +485,7 @@ class FinancialRepository extends BaseRepository
] ]
],]) ],])
]); ]);
return $form->setTitle('退保证金审核'); return $form->setTitle('退金审核');
} }
/** /**
@ -647,7 +647,7 @@ class FinancialRepository extends BaseRepository
} }
/** /**
* TODO 同意退保证 * TODO 同意退
* @param $res * @param $res
* @author Qinii * @author Qinii
* @day 1/27/22 * @day 1/27/22
@ -657,10 +657,10 @@ class FinancialRepository extends BaseRepository
//验证 //验证
$comp = bccomp($res['financial_account']->pay_price, $res['extract_money'], 2); $comp = bccomp($res['financial_account']->pay_price, $res['extract_money'], 2);
if ($comp == -1) if ($comp == -1)
throw new ValidateException('申请退款金额:'.$res['extract_money'].',大于支付保证金:'.$res['financial_account']->pay_price); throw new ValidateException('申请退款金额:'.$res['extract_money'].',大于支付金:'.$res['financial_account']->pay_price);
// if (bccomp($res['merchant']['margin'], $res['extract_money'],2) == -1) // if (bccomp($res['merchant']['margin'], $res['extract_money'],2) == -1)
// throw new ValidateException('申请退款金额:'.$res['extract_money'].',大于剩余保证金:'.$res['merchant']['margin']); // throw new ValidateException('申请退款金额:'.$res['extract_money'].',大于剩余金:'.$res['merchant']['margin']);
Db::transaction(function () use ($res){ Db::transaction(function () use ($res){
//退款 //退款

View File

@ -254,7 +254,7 @@ class FinancialRecordRepository extends BaseRepository
{ {
//商户收入 //商户收入
$count = $this->dao->search($where)->where('financial_type', 'in', ['order', 'mer_presell'])->sum('number'); $count = $this->dao->search($where)->where('financial_type', 'in', ['order', 'mer_presell'])->sum('number');
//保证 //
$auto_margin = $this->dao->search($where)->where('financial_type', 'auto_margin')->sum('number'); $auto_margin = $this->dao->search($where)->where('financial_type', 'auto_margin')->sum('number');
$auto_margin_refund = $this->dao->search($where)->where('financial_type', 'auto_margin_refund')->sum('number'); $auto_margin_refund = $this->dao->search($where)->where('financial_type', 'auto_margin_refund')->sum('number');
//平台优惠券 //平台优惠券
@ -330,7 +330,7 @@ class FinancialRecordRepository extends BaseRepository
'className' => 'el-icon-s-cooperation', 'className' => 'el-icon-s-cooperation',
'count' => bcsub($auto_margin,$auto_margin_refund,2), 'count' => bcsub($auto_margin,$auto_margin_refund,2),
'field' => '元', 'field' => '元',
'name' => '商户保证金金额' 'name' => '商户金金额'
], ],
]; ];
return compact('stat'); return compact('stat');
@ -490,7 +490,7 @@ class FinancialRecordRepository extends BaseRepository
bcsub($expend['count_order_charge'], $expend['count_charge']). '笔', bcsub($expend['count_order_charge'], $expend['count_charge']). '笔',
], ],
[ [
'店铺保证金', '店铺金',
$expend['number_auto_margin'] . '元', $expend['number_auto_margin'] . '元',
$expend['count_auto_margin'] . '笔' $expend['count_auto_margin'] . '笔'
@ -674,10 +674,10 @@ class FinancialRecordRepository extends BaseRepository
$financialType = ['order_charge', 'presell_charge']; $financialType = ['order_charge', 'presell_charge'];
[$data['count_order_charge'], $data['number_order_charge']] = $this->dao->getDataByType($type, $where, $date, $financialType); [$data['count_order_charge'], $data['number_order_charge']] = $this->dao->getDataByType($type, $where, $date, $financialType);
//商户保证 //商户
$financialType = ['auto_margin']; $financialType = ['auto_margin'];
[$data['count_auto_margin'], $data['number_auto_margin']] = $this->dao->getDataByType($type, $where, $date, $financialType); [$data['count_auto_margin'], $data['number_auto_margin']] = $this->dao->getDataByType($type, $where, $date, $financialType);
//商户保证金退回 //商户金退回
$financialType = ['auto_margin_refund']; $financialType = ['auto_margin_refund'];
[$data['count_auto_margin_refund'], $data['number_auto_margin_refund']] = $this->dao->getDataByType($type, $where, $date, $financialType); [$data['count_auto_margin_refund'], $data['number_auto_margin_refund']] = $this->dao->getDataByType($type, $where, $date, $financialType);
$number3 = bcsub($data['number_auto_margin'], $data['number_auto_margin_refund'], 2); $number3 = bcsub($data['number_auto_margin'], $data['number_auto_margin_refund'], 2);

View File

@ -137,7 +137,7 @@ class MerchantIntentionRepository extends BaseRepository
'is_bro_goods' => $config['broadcast_goods_type'] == 1 ? 0 : 1, 'is_bro_goods' => $config['broadcast_goods_type'] == 1 ? 0 : 1,
'mer_password' => $password, 'mer_password' => $password,
'is_margin' => $margin['is_margin'] ?? -1, 'is_margin' => $margin['is_margin'] ?? -1,
// 用户需缴纳保证 // 用户需缴纳
'margin' => $margin['margin'] ?? 0, 'margin' => $margin['margin'] ?? 0,
'uid' => $intention['uid'], 'uid' => $intention['uid'],
'reg_admin_id' => $autoCreate ? 0: request()->adminId(), 'reg_admin_id' => $autoCreate ? 0: request()->adminId(),

View File

@ -66,14 +66,14 @@ use think\Model;
class MerchantRepository extends BaseRepository class MerchantRepository extends BaseRepository
{ {
const WithoutMargin = 0; //不需要保证 const WithoutMargin = 0; //不需要
const NeedMargin = 1; //需要保证 const NeedMargin = 1; //需要
const PaidMargin = 10; //已支付保证 const PaidMargin = 10; //已支付
const RefundMargin = -1; //申请退还保证 const RefundMargin = -1; //申请退还
const RefuseMargin = -10; //拒绝退还保证 const RefuseMargin = -10; //拒绝退还
public $merId; public $merId;
public $forceMargin = false; //强制扣除保证 public $forceMargin = false; //强制扣除
/** /**
* MerchantRepository constructor. * MerchantRepository constructor.
@ -622,17 +622,17 @@ class MerchantRepository extends BaseRepository
{ {
$merchant = $this->dao->get($id); $merchant = $this->dao->get($id);
if ($merchant->is_margin !== 10) { if ($merchant->is_margin !== 10) {
throw new ValidateException('商户无保证金可扣'); throw new ValidateException('商户无金可扣');
} }
$form = Elm::createForm(Route::buildUrl('systemMarginSet')->build()); $form = Elm::createForm(Route::buildUrl('systemMarginSet')->build());
$form->setRule([ $form->setRule([
Elm::input('mer_name', '商户名称', $merchant->mer_name)->disabled(true), Elm::input('mer_name', '商户名称', $merchant->mer_name)->disabled(true),
Elm::input('mer_id', '商户ID', $merchant->mer_id)->disabled(true), Elm::input('mer_id', '商户ID', $merchant->mer_id)->disabled(true),
Elm::input('margin', '商户剩余保证金', $merchant->paid_margin)->disabled(true), Elm::input('margin', '商户剩余金', $merchant->paid_margin)->disabled(true),
Elm::number('number', '保证金扣除金额', 0)->max($merchant->paid_margin)->precision(2)->required(), Elm::number('number', '金扣除金额', 0)->max($merchant->paid_margin)->precision(2)->required(),
Elm::text('mark', '保证金扣除原因')->required(), Elm::text('mark', '金扣除原因')->required(),
]); ]);
return $form->setTitle('扣除保证金'); return $form->setTitle('扣除金');
} }
/** /**
@ -646,14 +646,14 @@ class MerchantRepository extends BaseRepository
{ {
$merechant = $this->dao->get($data['mer_id']); $merechant = $this->dao->get($data['mer_id']);
if ($merechant->is_margin !== 10) { if ($merechant->is_margin !== 10) {
throw new ValidateException('商户未支付保证金或已申请退款'); throw new ValidateException('商户未支付金或已申请退款');
} }
if ($data['number'] < 0) { if ($data['number'] < 0) {
throw new ValidateException('扣除保证金额不能小于0'); throw new ValidateException('扣除金额不能小于0');
} }
if (bccomp($merechant->paid_margin, $data['number'], 2) == -1) { if (bccomp($merechant->paid_margin, $data['number'], 2) == -1) {
throw new ValidateException('扣除保证金额不足'); throw new ValidateException('扣除金额不足');
} }
$data['balance'] = bcsub($merechant->paid_margin, $data['number'], 2); $data['balance'] = bcsub($merechant->paid_margin, $data['number'], 2);
@ -679,7 +679,7 @@ class MerchantRepository extends BaseRepository
} }
/** /**
* 自动扣除保证 * 自动扣除
* @param $income * @param $income
* @param $order * @param $order
* @param $finance * @param $finance
@ -691,12 +691,12 @@ class MerchantRepository extends BaseRepository
{ {
$merchant = Merchant::find($this->merId); $merchant = Merchant::find($this->merId);
$margin_type = Db::name('MerchantType')->where('mer_type_id', $merchant['type_id'])->value('margin'); $margin_type = Db::name('MerchantType')->where('mer_type_id', $merchant['type_id'])->value('margin');
//商户保证金大于支付保证金 或者forceMargin==false 直接返回 不计算保证 //商户押金大于支付押金 或者forceMargin==false 直接返回 不计算押
if ($merchant['paid_margin']>= $margin_type|| ($this->forceMargin === false && $merchant['auto_margin_rate'] == 0)) { if ($merchant['paid_margin']>= $margin_type|| ($this->forceMargin === false && $merchant['auto_margin_rate'] == 0)) {
return [$income, $finance, false]; return [$income, $finance, false];
} }
$rate = $this->forceMargin ? 100 : $merchant['auto_margin_rate']; $rate = $this->forceMargin ? 100 : $merchant['auto_margin_rate'];
// //商户保证金未完全缴纳且设置了自动扣除比例 // //商户金未完全缴纳且设置了自动扣除比例
$margin= bcmul($income, bcdiv($rate, 100,2), 2); $margin= bcmul($income, bcdiv($rate, 100,2), 2);
// $margin = min(bcsub($margin, $merchant['paid_margin'], 2), $margin); // $margin = min(bcsub($margin, $merchant['paid_margin'], 2), $margin);
// $income = max(bcsub($income, $margin, 2), 0); // $income = max(bcsub($income, $margin, 2), 0);

View File

@ -124,7 +124,7 @@ class MerchantTypeRepository extends BaseRepository
$make = app()->make(RelevanceRepository::class); $make = app()->make(RelevanceRepository::class);
$make->batchDelete($id, RelevanceRepository::TYPE_MERCHANT_AUTH); $make->batchDelete($id, RelevanceRepository::TYPE_MERCHANT_AUTH);
$make->insertAll($inserts); $make->insertAll($inserts);
//更新未交保证金的商户 //更新未交金的商户
app()->make(MerchantRepository::class)->updateMargin($id, $data['margin'], $data['is_margin']); app()->make(MerchantRepository::class)->updateMargin($id, $data['margin'], $data['is_margin']);
}); });
} }

View File

@ -38,7 +38,7 @@ class ServeOrderRepository extends BaseRepository
const TYPE_COPY_PRODUCT = 1; const TYPE_COPY_PRODUCT = 1;
//电子面单 //电子面单
const TYPE_DUMP = 2; const TYPE_DUMP = 2;
//保证金 margin //金 margin
const TYPE_MARGIN = 10; const TYPE_MARGIN = 10;
//同城配送delivery //同城配送delivery
const TYPE_DELIVERY = 20; const TYPE_DELIVERY = 20;
@ -83,7 +83,7 @@ class ServeOrderRepository extends BaseRepository
} }
/** /**
* TODO 商户保证支付 * TODO 商户支付
* @param $merId * @param $merId
* @param $data * @param $data
* @return array * @return array
@ -93,7 +93,7 @@ class ServeOrderRepository extends BaseRepository
public function margin($merId, $data) public function margin($merId, $data)
{ {
$ret = app()->make(MerchantRepository::class)->get($merId); $ret = app()->make(MerchantRepository::class)->get($merId);
if ($ret['is_margin'] !== 1) throw new ValidateException('此商户无需支付保证金'); if ($ret['is_margin'] !== 1) throw new ValidateException('此商户无需支付金');
$key = 'Margin_'.$merId.'_'.date('YmdH',time()); $key = 'Margin_'.$merId.'_'.date('YmdH',time());
$arr = [ $arr = [
'type_id' => $ret['type_id'], 'type_id' => $ret['type_id'],

View File

@ -67,11 +67,11 @@ class MerchantMargin extends BaseController
public function setMargin() public function setMargin()
{ {
$data = $this->request->params(['mer_id','number',['type','mer_margin'],'mark']); $data = $this->request->params(['mer_id','number',['type','mer_margin'],'mark']);
$data['title'] = '保证金扣除'; $data['title'] = '金扣除';
if ($data['number'] < 0) if ($data['number'] < 0)
return app('json')->fail('扣除金额不能小于0'); return app('json')->fail('扣除金额不能小于0');
app()->make(MerchantRepository::class)->setMargin($data); app()->make(MerchantRepository::class)->setMargin($data);
return app('json')->success('扣除保证金成功'); return app('json')->success('扣除金成功');
} }
} }

View File

@ -95,7 +95,7 @@ class MerchantType extends BaseController
$validate = app()->make(MerchantTypeValidate::class); $validate = app()->make(MerchantTypeValidate::class);
$validate->check($data); $validate->check($data);
if ($data['is_margin'] == 1) { if ($data['is_margin'] == 1) {
if ($data['margin'] <= 0) throw new ValidateException('保证金必须大于0'); if ($data['margin'] <= 0) throw new ValidateException('金必须大于0');
} else { } else {
$data['margin'] = 0; $data['margin'] = 0;
} }

View File

@ -391,7 +391,7 @@ class Auth extends BaseController
return app('json')->fail('没有店铺'); return app('json')->fail('没有店铺');
} }
if ($merchant['is_margin'] == 10) { if ($merchant['is_margin'] == 10) {
return app('json')->fail('保证金已缴纳'); return app('json')->fail('金已缴纳');
} }
if ($merchant['margin'] == 0) { if ($merchant['margin'] == 0) {
$margin = Db::name('MerchantType')->where('mer_type_id', $merchant['type_id'])->value('margin'); $margin = Db::name('MerchantType')->where('mer_type_id', $merchant['type_id'])->value('margin');

View File

@ -215,7 +215,7 @@ class Merchant extends BaseController
$data = $this->request->params(['mer_state']); $data = $this->request->params(['mer_state']);
if ($merchant['is_margin'] == 1 && $data['mer_state'] == 1) if ($merchant['is_margin'] == 1 && $data['mer_state'] == 1)
return app('json')->fail('开启店铺前请先支付保证金'); return app('json')->fail('开启店铺前请先支付金');
if ($data['mer_state'] && !$merchant['sub_mchid'] && systemConfig('open_wx_combine')) if ($data['mer_state'] && !$merchant['sub_mchid'] && systemConfig('open_wx_combine'))
return app('json')->fail('开启店铺前请先完成微信子商户入驻'); return app('json')->fail('开启店铺前请先完成微信子商户入驻');

View File

@ -122,7 +122,7 @@ class Merchant extends BaseController
$data = $this->request->params(['mer_state']); $data = $this->request->params(['mer_state']);
if ($merchant->is_margin == 1 && $data['mer_state'] == 1) if ($merchant->is_margin == 1 && $data['mer_state'] == 1)
return app('json')->fail('开启店铺前请先支付保证金'); return app('json')->fail('开启店铺前请先支付金');
if ($data['mer_state'] && !$merchant->sub_mchid && systemConfig('open_wx_combine')) if ($data['mer_state'] && !$merchant->sub_mchid && systemConfig('open_wx_combine'))
return app('json')->fail('开启店铺前请先完成微信子商户入驻'); return app('json')->fail('开启店铺前请先完成微信子商户入驻');

View File

@ -34,7 +34,7 @@ class AfterRefund
if (in_array($financialRecord['financial_type'], ['commission_to_cloud_warehouse', 'commission_to_entry_merchant', 'commission_to_service_team', 'commission_to_village', 'commission_to_town', ])) { if (in_array($financialRecord['financial_type'], ['commission_to_cloud_warehouse', 'commission_to_entry_merchant', 'commission_to_service_team', 'commission_to_village', 'commission_to_town', ])) {
//佣金类型的退还佣金 //佣金类型的退还佣金
if ($financialRecord['financial_type'] == 'commission_to_entry_merchant') { if ($financialRecord['financial_type'] == 'commission_to_entry_merchant') {
//入口店铺的佣金,如果有保证金,不退佣金 //入口店铺的佣金,如果有金,不退佣金
$isMargin = $this->isMargin($financialRecords, $financialRecord['mer_id']); $isMargin = $this->isMargin($financialRecords, $financialRecord['mer_id']);
if (!$isMargin) { if (!$isMargin) {
$this->subMoney($financialRecord); $this->subMoney($financialRecord);
@ -49,7 +49,7 @@ class AfterRefund
} }
if ($financialRecord['financial_type'] == 'auto_margin') { if ($financialRecord['financial_type'] == 'auto_margin') {
Log::info("refundMargin, mer_id: {$financialRecord['mer_id']}, money: {$financialRecord['number']}"); Log::info("refundMargin, mer_id: {$financialRecord['mer_id']}, money: {$financialRecord['number']}");
//保证金类型的扣除保证 //押金类型的扣除押
ServeOrder::getInstance()->where('store_order_id', $financialRecord['order_id'])->update(['is_del' => 1]); ServeOrder::getInstance()->where('store_order_id', $financialRecord['order_id'])->update(['is_del' => 1]);
$merchant = app()->make(MerchantDao::class)->get($financialRecord['mer_id']); $merchant = app()->make(MerchantDao::class)->get($financialRecord['mer_id']);
$merchant->paid_margin = max(bcsub($merchant['paid_margin'], $financialRecord['number'], 2), 0); $merchant->paid_margin = max(bcsub($merchant['paid_margin'], $financialRecord['number'], 2), 0);
@ -65,7 +65,7 @@ class AfterRefund
} }
/** /**
* 是否有保证 * 是否有
* @param $financialRecords * @param $financialRecords
* @param $merId * @param $merId
* @return bool * @return bool

View File

@ -14,7 +14,7 @@ class paySuccessMargin
public $event; public $event;
public function handle($event) public function handle($event)
{ {
Log::info('微信支付保证金成功回调' . json_encode($event)); Log::info('微信支付金成功回调' . json_encode($event));
Db::startTrans(); Db::startTrans();
try { try {
$order_sn = $event['order_sn']; $order_sn = $event['order_sn'];
@ -27,7 +27,7 @@ class paySuccessMargin
$merchantInfo = Db::name('merchant')->where('mer_id', $marginInfo['mer_id'])->where('uid', $marginInfo['uid'])->find(); $merchantInfo = Db::name('merchant')->where('mer_id', $marginInfo['mer_id'])->where('uid', $marginInfo['uid'])->find();
$merchant_type = Db::name('merchant_type')->where('mer_type_id', $merchantInfo['type_id'])->find(); $merchant_type = Db::name('merchant_type')->where('mer_type_id', $merchantInfo['type_id'])->find();
//已支付的保证 //已支付的
$paidMarginAmount = bcadd($merchantInfo['paid_margin'], $marginInfo['total_price'], 2); $paidMarginAmount = bcadd($merchantInfo['paid_margin'], $marginInfo['total_price'], 2);
Db::name('merchant')->where('mer_id', $marginInfo['mer_id'])->where('uid', $marginInfo['uid'])->update([ Db::name('merchant')->where('mer_id', $marginInfo['mer_id'])->where('uid', $marginInfo['uid'])->update([
'paid_margin' => $paidMarginAmount,'ot_margin'=>$paidMarginAmount 'paid_margin' => $paidMarginAmount,'ot_margin'=>$paidMarginAmount
@ -45,7 +45,7 @@ class paySuccessMargin
// 提交事务 // 提交事务
Db::commit(); Db::commit();
} catch (\Exception $e) { } catch (\Exception $e) {
Log::error('微信支付保证金失败' . $e->getMessage()); Log::error('微信支付金失败' . $e->getMessage());
// 回滚事务 // 回滚事务
Db::rollback(); Db::rollback();
} }

View File

@ -22,9 +22,9 @@ class MerchantTypeValidate extends Validate
protected $rule = [ protected $rule = [
'type_name|店铺类型名称' => 'require|max:5', 'type_name|店铺类型名称' => 'require|max:5',
'type_info|店铺类型要求' => 'max:256', 'type_info|店铺类型要求' => 'max:256',
'is_margin|是否有保证金' => 'require|in:0,1', 'is_margin|是否有金' => 'require|in:0,1',
'auth|权限' => 'require|array|min:1', 'auth|权限' => 'require|array|min:1',
'margin|保证金(¥)' => 'requireIf:is_margin,1', 'margin|金(¥)' => 'requireIf:is_margin,1',
'description|其他说明' => 'max:256', 'description|其他说明' => 'max:256',
]; ];
} }

View File

@ -51,8 +51,8 @@ class MerchantValidate extends Validate
'is_bro_room|直播间状态' => 'require|in:0,1', 'is_bro_room|直播间状态' => 'require|in:0,1',
'is_trader|自营状态' => 'require|in:0,1', 'is_trader|自营状态' => 'require|in:0,1',
'commission_rate|提成比例' => '>=:0', 'commission_rate|提成比例' => '>=:0',
'auto_margin_rate|自动扣除保证金比例' => '>=:0', 'auto_margin_rate|自动扣除金比例' => '>=:0',
'paid_margin|已支付的保证金' => '>=:0', 'paid_margin|已支付的金' => '>=:0',
]; ];
/** /**

View File

@ -62,9 +62,9 @@ return [
'APPLYMENTS_FAIL' => 550523, 'APPLYMENTS_FAIL' => 550523,
//商户申请分账待验证 //商户申请分账待验证
'APPLYMENTS_SIGN' => 550525, 'APPLYMENTS_SIGN' => 550525,
//商户申请退回保证金通过 //商户申请退回金通过
'REFUND_MARGIN_SUCCESS' => 710327, 'REFUND_MARGIN_SUCCESS' => 710327,
//商户申请退回保证金未通过 //商户申请退回金未通过
'REFUND_MARGIN_FAIL' => 710328, 'REFUND_MARGIN_FAIL' => 710328,
], ],
//微信 //微信

View File

@ -72,9 +72,9 @@ return [
'APPLYMENTS_SIGN' => 550525, 'APPLYMENTS_SIGN' => 550525,
//商户申请分账未通过 2.1 //商户申请分账未通过 2.1
'APPLYMENTS_FAIL' => 550523, 'APPLYMENTS_FAIL' => 550523,
//商户申请退回保证金通过 2.1 //商户申请退回金通过 2.1
'REFUND_MARGIN_SUCCESS' => 710327, 'REFUND_MARGIN_SUCCESS' => 710327,
//商户申请退回保证金未通过 2.1 //商户申请退回金未通过 2.1
'REFUND_MARGIN_FAIL' => 710328, 'REFUND_MARGIN_FAIL' => 710328,
//付费会员充值成功提醒 2.1 //付费会员充值成功提醒 2.1
'SVIP_PAY_SUCCESS' => 856046 'SVIP_PAY_SUCCESS' => 856046
@ -130,9 +130,9 @@ return [
'APPLYMENTS_FAIL' => '', 'APPLYMENTS_FAIL' => '',
//商户申请分账待验证 //商户申请分账待验证
'APPLYMENTS_SIGN' => '', 'APPLYMENTS_SIGN' => '',
//商户申请退回保证金通过 //商户申请退回金通过
'REFUND_MARGIN_SUCCESS' => '', 'REFUND_MARGIN_SUCCESS' => '',
//商户申请退回保证金未通过 //商户申请退回金未通过
'REFUND_MARGIN_FAIL' => '', 'REFUND_MARGIN_FAIL' => '',
], ],
] ]

View File

@ -354,7 +354,7 @@ class ExcelService
'order_presell' => '预售订单(定金)', 'order_presell' => '预售订单(定金)',
'refund_platform_coupon' => '退回优惠券补贴', 'refund_platform_coupon' => '退回优惠券补贴',
'order_platform_coupon' => '优惠券补贴', 'order_platform_coupon' => '优惠券补贴',
'auto_margin' => '保证金', 'auto_margin' => '金',
'commission_to_service_team' => '订单平台佣金', 'commission_to_service_team' => '订单平台佣金',
'commission_to_platform' => '订单剩余平台手续费', 'commission_to_platform' => '订单剩余平台手续费',
'commission_to_village' => '订单平台佣金', 'commission_to_village' => '订单平台佣金',
@ -363,7 +363,7 @@ class ExcelService
'commission_to_platform_refund' => '退回剩余平台手续费', 'commission_to_platform_refund' => '退回剩余平台手续费',
'commission_to_village_refund' => '退回平台佣金', 'commission_to_village_refund' => '退回平台佣金',
'commission_to_town_refund' => '退回平台佣金', 'commission_to_town_refund' => '退回平台佣金',
'auto_margin_refund' => '退回保证金', 'auto_margin_refund' => '退回金',
'commission_to_entry_merchant' => '订单平台佣金', 'commission_to_entry_merchant' => '订单平台佣金',
'commission_to_cloud_warehouse' => '订单平台佣金', 'commission_to_cloud_warehouse' => '订单平台佣金',
'commission_to_entry_merchant_refund' => '退回平台佣金', 'commission_to_entry_merchant_refund' => '退回平台佣金',

View File

@ -261,10 +261,10 @@ class SmsService
'site' => systemConfig('site_name'), 'site' => systemConfig('site_name'),
]); ]);
break; break;
//保证金退回申请通过通知 2.1 //金退回申请通过通知 2.1
case 'REFUND_MARGIN_SUCCESS': case 'REFUND_MARGIN_SUCCESS':
//nobreak; //nobreak;
//保证金退回申请未通过通知 2.1 //金退回申请未通过通知 2.1
case 'REFUND_MARGIN_FAIL': case 'REFUND_MARGIN_FAIL':
self::create()->send($id['phone'], $tempId, ['name' => $id['name'], 'time' => $id['time'],]); self::create()->send($id['phone'], $tempId, ['name' => $id['name'], 'time' => $id['time'],]);
break; break;

View File

@ -193,7 +193,7 @@ Route::group(function () {
'_auth' => true, '_auth' => true,
]); ]);
//保证 //
Route::group('margin', function () { Route::group('margin', function () {
//缴纳记录 //缴纳记录
Route::get('lst', 'merchant.MerchantMargin/lst')->name('systemMerchantMarginLst')->option([ Route::get('lst', 'merchant.MerchantMargin/lst')->name('systemMerchantMarginLst')->option([
@ -204,14 +204,14 @@ Route::group(function () {
'_alias' => '扣费记录', '_alias' => '扣费记录',
]); ]);
//扣除保证 //扣除
Route::get('set/:id/form', 'merchant.MerchantMargin/setMarginForm')->name('systemMarginSetForm')->option([ Route::get('set/:id/form', 'merchant.MerchantMargin/setMarginForm')->name('systemMarginSetForm')->option([
'_alias' => '扣除保证金表单', '_alias' => '扣除金表单',
'_auth' => false, '_auth' => false,
'_form' => 'systemMarginSet', '_form' => 'systemMarginSet',
]); ]);
Route::post('set', 'merchant.MerchantMargin/setMargin')->name('systemMarginSet')->option([ Route::post('set', 'merchant.MerchantMargin/setMargin')->name('systemMarginSet')->option([
'_alias' => '扣除保证金', '_alias' => '扣除金',
]); ]);
//退款申请 //退款申请

View File

@ -73,7 +73,7 @@ Route::group('api/', function () {
//绑定推荐人 //绑定推荐人
Route::post('user/spread', 'api.Auth/spread'); Route::post('user/spread', 'api.Auth/spread');
//用户缴纳保证 //用户缴纳
Route::post('user/margin', 'api.Auth/doMargin'); Route::post('user/margin', 'api.Auth/doMargin');
Route::get('user/margin/list', 'api.Auth/marginList'); Route::get('user/margin/list', 'api.Auth/marginList');

View File

@ -19,7 +19,7 @@ Route::group(function () {
Route::group('financial', function () { Route::group('financial', function () {
Route::post('refund/margin', 'Financial/refundMargin')->name('merchantFinancialRefundMargin')->option([ Route::post('refund/margin', 'Financial/refundMargin')->name('merchantFinancialRefundMargin')->option([
'_alias' => '退保证金申请', '_alias' => '退金申请',
]); ]);
})->prefix('merchant.system.financial.')->option([ })->prefix('merchant.system.financial.')->option([
'_path' => 'merchant/margin', '_path' => 'merchant/margin',