提现修改:打款确认增加实际打款金额

This commit is contained in:
焦钰锟 2025-04-17 10:33:38 +08:00
parent a9a4ebe154
commit 969b8319c6
5 changed files with 37 additions and 4 deletions

View File

@ -133,8 +133,12 @@ class UserwithdrawalLog extends Backend
$remark = $params["remark"]; $remark = $params["remark"];
$real_have_price = $params["real_have_price"];
if($real_have_price <= 0) $this->error("请输入正确的打款金额");
$model = (new \app\common\model\user\withdrawal\UserwithdrawalLog); $model = (new \app\common\model\user\withdrawal\UserwithdrawalLog);
$model->paidAlready($ids,$remark,true); $model->paidAlready($ids,$real_have_price,$remark,true);
}catch (\Throwable $e){ }catch (\Throwable $e){
$this->error($e->getMessage()); $this->error($e->getMessage());

View File

@ -2,8 +2,12 @@
return [ return [
'Price' => '提现金额', 'Price' => '提现金额',
'Fee_price' => '手续费', 'Fee_price' => '平台手续费',
'Real_price' => '实际应打款额', 'Real_price' => '预计应打款额(扣除手续费)',
'Real_have_price' => '最终打款额',
'Real_fee_price' => '最终扣除手续费(包含各行转账手续费)',
'Status' => '提现申请状态', 'Status' => '提现申请状态',
'Status 1' => '待审核', 'Status 1' => '待审核',
'Set status to 1' => '设为待审核', 'Set status to 1' => '设为待审核',

View File

@ -71,6 +71,16 @@
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Real_have_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-real_have_price" class="form-control" step="0.01" name="row[real_have_price]" type="number" value="{$row.real_price|htmlentities}">
<span style="color: red">( 因手续费根据不同银行和地区可能存在的增减,请核对并修正实际到对方账户的金额! ) </span>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('打款备注')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('打款备注')}:</label>
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">

View File

@ -343,7 +343,7 @@ class UserwithdrawalLog extends BaseModel
* @return true * @return true
* @throws \Exception * @throws \Exception
*/ */
public function paidAlready($id,$remark="",$trans=false){ public function paidAlready($id,$real_have_price,$remark="",$trans=false){
//找到需要审核的提现记录 //找到需要审核的提现记录
$userwithdrawalLog = self::where('id',$id) $userwithdrawalLog = self::where('id',$id)
@ -353,6 +353,12 @@ class UserwithdrawalLog extends BaseModel
if(!$userwithdrawalLog) throw new \Exception("提现记录不存在"); if(!$userwithdrawalLog) throw new \Exception("提现记录不存在");
if($userwithdrawalLog['status']!='2') throw new \Exception("审核通过的订单才能标记打款"); if($userwithdrawalLog['status']!='2') throw new \Exception("审核通过的订单才能标记打款");
if(!$remark) throw new \Exception("打款备注不能为空"); if(!$remark) throw new \Exception("打款备注不能为空");
if($real_have_price <= 0) throw new \Exception("请输入正确的打款金额");
if($real_have_price > $userwithdrawalLog['price']) throw new \Exception("打款金额不能大于提现金额");
//提现金额 - 实际到账金额 = 实际的手续费
$real_fee_price = bcsub($userwithdrawalLog['price'],$real_have_price,2);
//判断逻辑 //判断逻辑
if($trans){ if($trans){
self::beginTrans(); self::beginTrans();
@ -362,6 +368,10 @@ class UserwithdrawalLog extends BaseModel
//更新状态 //更新状态
$userwithdrawalLog["withdrawal_status"] = '3'; $userwithdrawalLog["withdrawal_status"] = '3';
$userwithdrawalLog["paytime"] = time(); $userwithdrawalLog["paytime"] = time();
$userwithdrawalLog["real_fee_price"] = $real_fee_price;
$userwithdrawalLog["real_have_price"] = $real_have_price;
$userwithdrawalLog["remark"] = $remark; $userwithdrawalLog["remark"] = $remark;
$userwithdrawalLog->save(); $userwithdrawalLog->save();
//调用事件 //调用事件

View File

@ -36,6 +36,11 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
{field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'price', title: __('Price'), operate:'BETWEEN'},
{field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'}, {field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'},
{field: 'real_price', title: __('Real_price'), operate:'BETWEEN'}, {field: 'real_price', title: __('Real_price'), operate:'BETWEEN'},
{field: 'real_have_price', title: __('Real_have_price'), operate:'BETWEEN'},
{field: 'real_fee_price', title: __('Real_fee_price'), operate:'BETWEEN'},
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'withdrawal_status', title: __('Withdrawal_status'), searchList: {"1":__('Withdrawal_status 1'),"2":__('Withdrawal_status 2'),"3":__('Withdrawal_status 3')}, formatter: Table.api.formatter.status}, {field: 'withdrawal_status', title: __('Withdrawal_status'), searchList: {"1":__('Withdrawal_status 1'),"2":__('Withdrawal_status 2'),"3":__('Withdrawal_status 3')}, formatter: Table.api.formatter.status},