diff --git a/addons/shopro/controller/Withdraw.php b/addons/shopro/controller/Withdraw.php index 0a9edb6..6513d5e 100644 --- a/addons/shopro/controller/Withdraw.php +++ b/addons/shopro/controller/Withdraw.php @@ -29,6 +29,9 @@ class Withdraw extends Common { $user = auth_user(); $config = (new WithdrawService($user))->config; + $config['madow_withdraw_enable'] = \addons\shopro\service\partner\PartnerConfig::isMadowWithdrawEnabled() ? 1 : 0; + $config['madow_min_amount'] = \addons\shopro\service\partner\PartnerConfig::madowWithdrawMin(); + $config['madow_charge_rate'] = \addons\shopro\service\partner\PartnerConfig::madowWithdrawChargeRate(); $this->success('提现规则', $config); } diff --git a/addons/shopro/controller/partner/Index.php b/addons/shopro/controller/partner/Index.php index 878a3ba..4d6433f 100644 --- a/addons/shopro/controller/partner/Index.php +++ b/addons/shopro/controller/partner/Index.php @@ -169,6 +169,7 @@ class Index extends Commission 'show_madow_rate' => PartnerConfig::showMadowRate(), 'can_withdraw_madow' => PartnerConfig::isMadowWithdrawEnabled() ? 1 : 0, 'madow_withdraw_min' => PartnerConfig::madowWithdrawMin(), + 'madow_withdraw_charge_rate' => PartnerConfig::madowWithdrawChargeRate(), 'rule_title' => PartnerConfig::madowRuleTitle(), 'rules' => PartnerConfig::madowRules(), 'list' => $list, diff --git a/addons/shopro/service/Withdraw.php b/addons/shopro/service/Withdraw.php index 4c0ecdc..b20c83f 100755 --- a/addons/shopro/service/Withdraw.php +++ b/addons/shopro/service/Withdraw.php @@ -160,6 +160,15 @@ class Withdraw throw new ShoproException('持仓dmepa不足,无法提现'); } + // 手续费计算 (内扣模式) + $chargeRatePercent = PartnerConfig::madowWithdrawChargeRate(); + $chargeRate = round($chargeRatePercent * 0.01, 4); + $chargeFee = function_exists('bcmul') ? bcmul((string)$money, (string)$chargeRate, 2) : number_format(floatval($money) * $chargeRate, 2, '.', ''); + if (floatval($chargeFee) > 0 && floatval($money) <= floatval($chargeFee)) { + throw new ShoproException('提现金额必须大于手续费'); + } + $realMoney = bcsub((string)$money, (string)$chargeFee, 2); + // 校验银行卡信息 $withdrawInfo = $this->getAccountInfo($type, $params); $rateClean = rtrim(rtrim(number_format((float)$rate, 12, '.', ''), '0'), '.'); @@ -168,9 +177,15 @@ class Withdraw $withdrawInfo['扣除DMEPA'] = $deductMadow . ' DMEPA'; $withdrawInfo['市值汇率'] = '1 DMEPA ≈ ' . $rateClean . ' 元'; $withdrawInfo['换算市值'] = $moneyClean . ' 元'; + if (floatval($chargeFee) > 0 || floatval($chargeRate) > 0) { + $withdrawInfo['提现手续费'] = number_format(floatval($chargeFee), 2, '.', '') . ' 元 (' . $chargeRatePercent . '%)'; + } + $withdrawInfo['预计到账'] = number_format(floatval($realMoney), 2, '.', '') . ' 元'; $withdrawInfo['wallet_type'] = 'madow'; $withdrawInfo['madow_amount'] = $deductMadow; $withdrawInfo['rate'] = $rate; + $withdrawInfo['charge_fee'] = $chargeFee; + $withdrawInfo['charge_rate'] = $chargeRate; // 扣减 dmepa $agent->setDec('madow', $deductMadow); @@ -179,8 +194,8 @@ class Withdraw $withdraw = new WithdrawModel(); $withdraw->user_id = $this->user->id; $withdraw->amount = $money; - $withdraw->charge_fee = 0; - $withdraw->charge_rate = 0; + $withdraw->charge_fee = $chargeFee; + $withdraw->charge_rate = $chargeRate; $withdraw->withdraw_sn = get_sn($this->user->id, 'W'); $withdraw->withdraw_type = 'bank'; $withdraw->withdraw_info = $withdrawInfo; @@ -205,6 +220,9 @@ class Withdraw 'deduct_madow' => $deductMadow, 'cny_amount' => $money, 'rate' => $rate, + 'charge_fee' => $chargeFee, + 'charge_rate' => $chargeRate, + 'real_amount' => $realMoney, ], 'settle_date' => date('Y-m-d'), 'status' => 1, diff --git a/addons/shopro/service/partner/PartnerConfig.php b/addons/shopro/service/partner/PartnerConfig.php index 42880a5..a2b678c 100644 --- a/addons/shopro/service/partner/PartnerConfig.php +++ b/addons/shopro/service/partner/PartnerConfig.php @@ -51,6 +51,12 @@ class PartnerConfig public static function isMadowWithdrawEnabled() { + if (function_exists('sheep_config')) { + $withdrawConfig = sheep_config('shop.recharge_withdraw.withdraw'); + if (isset($withdrawConfig['madow_withdraw_enable']) && $withdrawConfig['madow_withdraw_enable'] !== null && $withdrawConfig['madow_withdraw_enable'] !== '') { + return (bool) intval($withdrawConfig['madow_withdraw_enable']); + } + } $enable = self::get('partner_madow_withdraw_enable', 1); if ($enable === null || $enable === '') { return 1; @@ -60,6 +66,12 @@ class PartnerConfig public static function madowWithdrawMin() { + if (function_exists('sheep_config')) { + $withdrawConfig = sheep_config('shop.recharge_withdraw.withdraw'); + if (isset($withdrawConfig['madow_min_amount']) && is_numeric($withdrawConfig['madow_min_amount'])) { + return max(0.0, floatval($withdrawConfig['madow_min_amount'])); + } + } $min = self::get('partner_madow_withdraw_min', 1); if ($min === null || $min === '' || !is_numeric($min)) { return 1.0; @@ -67,6 +79,21 @@ class PartnerConfig return max(0.0, floatval($min)); } + public static function madowWithdrawChargeRate() + { + if (function_exists('sheep_config')) { + $withdrawConfig = sheep_config('shop.recharge_withdraw.withdraw'); + if (isset($withdrawConfig['madow_charge_rate']) && is_numeric($withdrawConfig['madow_charge_rate'])) { + return max(0.0, floatval($withdrawConfig['madow_charge_rate'])); + } + } + $rate = self::get('partner_madow_withdraw_charge_rate', 0); + if ($rate === null || $rate === '' || !is_numeric($rate)) { + return 0.0; + } + return max(0.0, floatval($rate)); + } + public static function madowRuleTitle() { $title = trim((string) self::get('partner_madow_rule_title', '市值与增值规则')) ?: '市值与增值规则'; diff --git a/application/admin/controller/shopro/Config.php b/application/admin/controller/shopro/Config.php index 5a88ed0..7be5fe8 100644 --- a/application/admin/controller/shopro/Config.php +++ b/application/admin/controller/shopro/Config.php @@ -197,7 +197,7 @@ class Config extends Common 'partner_show_madow_rate', 'partner_madow_base_rate', 'partner_madow_step_orders', 'partner_madow_rule_title', 'partner_madow_rules', - 'partner_madow_withdraw_enable', 'partner_madow_withdraw_min', + 'partner_madow_withdraw_enable', 'partner_madow_withdraw_min', 'partner_madow_withdraw_charge_rate', 'partner_voucher_times', 'partner_voucher_days', 'partner_voucher_rule_title', 'partner_voucher_rules', 'partner_maker_bonus', 'partner_maker_peer_rate', @@ -238,6 +238,7 @@ class Config extends Common 'partner_show_madow_rate' => 1, 'partner_madow_withdraw_enable' => 1, 'partner_madow_withdraw_min' => 1, + 'partner_madow_withdraw_charge_rate' => 0, 'partner_madow_base_rate' => '0.00000075', 'partner_madow_step_orders' => 1, 'partner_voucher_times' => 1.5, @@ -266,6 +267,7 @@ class Config extends Common $configs['partner_show_madow_rate'] = isset($configs['partner_show_madow_rate']) ? intval($configs['partner_show_madow_rate']) : 1; $configs['partner_madow_withdraw_enable'] = isset($configs['partner_madow_withdraw_enable']) ? intval($configs['partner_madow_withdraw_enable']) : 1; $configs['partner_madow_withdraw_min'] = isset($configs['partner_madow_withdraw_min']) ? floatval($configs['partner_madow_withdraw_min']) : 1.0; + $configs['partner_madow_withdraw_charge_rate'] = isset($configs['partner_madow_withdraw_charge_rate']) ? floatval($configs['partner_madow_withdraw_charge_rate']) : 0.0; foreach (['partner_madow_rules', 'partner_voucher_rules'] as $ruleKey) { if (isset($configs[$ruleKey]) && is_string($configs[$ruleKey])) { $decoded = json_decode($configs[$ruleKey], true); @@ -292,6 +294,9 @@ class Config extends Common if (isset($save['partner_madow_withdraw_min'])) { $save['partner_madow_withdraw_min'] = max(0.0, floatval($save['partner_madow_withdraw_min'])); } + if (isset($save['partner_madow_withdraw_charge_rate'])) { + $save['partner_madow_withdraw_charge_rate'] = max(0.0, floatval($save['partner_madow_withdraw_charge_rate'])); + } // 确保数据库存在 partner_show_madow_rate 配置行 $existConfig = ShoproConfig::where('code', 'shop.commission.partner_show_madow_rate')->find(); if (!$existConfig) { @@ -309,6 +314,7 @@ class Config extends Common $ensureConfigs = [ 'shop.commission.partner_madow_withdraw_enable' => ['name' => '开启dmepa提现', 'desc' => '1=开启 0=关闭', 'type' => 'int', 'value' => '1', 'weigh' => 86], 'shop.commission.partner_madow_withdraw_min' => ['name' => 'dmepa最低提现金额', 'desc' => 'dmepa最低提现金额(元)', 'type' => 'number', 'value' => '1', 'weigh' => 86], + 'shop.commission.partner_madow_withdraw_charge_rate' => ['name' => 'dmepa提现手续费率', 'desc' => 'dmepa提现手续费率(%)', 'type' => 'number', 'value' => '0', 'weigh' => 86], 'shop.commission.partner_madow_rule_title' => ['name' => 'dmepa规则弹窗标题', 'desc' => '我的dmepa市值规则弹窗标题', 'type' => 'string', 'value' => '市值与增值规则', 'weigh' => 86], 'shop.commission.partner_madow_rules' => ['name' => 'dmepa规则说明条目', 'desc' => '我的dmepa市值规则条目', 'type' => 'array', 'value' => json_encode($ruleDefaults['partner_madow_rules'], JSON_UNESCAPED_UNICODE), 'weigh' => 86], 'shop.commission.partner_voucher_rule_title' => ['name' => '兑换券规则弹窗标题', 'desc' => '兑换券规则弹窗标题', 'type' => 'string', 'value' => '兑换券释放与使用规则', 'weigh' => 89], @@ -411,6 +417,29 @@ class Config extends Common } else { $configs['withdraw']['status'] = intval($configs['withdraw']['status']); } + + // 读取 DMEPA 专属提现配置(优先提现配置,降级兼容合伙股东历史配置) + $partnerEnable = ShoproConfig::getConfigField('shop.commission.partner_madow_withdraw_enable', false); + $partnerMin = ShoproConfig::getConfigField('shop.commission.partner_madow_withdraw_min', false); + $partnerChargeRate = ShoproConfig::getConfigField('shop.commission.partner_madow_withdraw_charge_rate', false); + + if (!isset($configs['withdraw']['madow_withdraw_enable']) || $configs['withdraw']['madow_withdraw_enable'] === '') { + $configs['withdraw']['madow_withdraw_enable'] = ($partnerEnable !== null && $partnerEnable !== '') ? intval($partnerEnable) : 1; + } else { + $configs['withdraw']['madow_withdraw_enable'] = intval($configs['withdraw']['madow_withdraw_enable']); + } + + if (!isset($configs['withdraw']['madow_min_amount']) || $configs['withdraw']['madow_min_amount'] === '') { + $configs['withdraw']['madow_min_amount'] = ($partnerMin !== null && $partnerMin !== '') ? floatval($partnerMin) : 1.0; + } else { + $configs['withdraw']['madow_min_amount'] = floatval($configs['withdraw']['madow_min_amount']); + } + + if (!isset($configs['withdraw']['madow_charge_rate']) || $configs['withdraw']['madow_charge_rate'] === '') { + $configs['withdraw']['madow_charge_rate'] = ($partnerChargeRate !== null && $partnerChargeRate !== '') ? floatval($partnerChargeRate) : 0.0; + } else { + $configs['withdraw']['madow_charge_rate'] = floatval($configs['withdraw']['madow_charge_rate']); + } } } elseif ('POST' === $this->request->method()) { $params = $this->request->param(); @@ -428,7 +457,38 @@ class Config extends Common } else { $params['withdraw']['status'] = intval($params['withdraw']['status']); } + + if (isset($params['withdraw'])) { + if (isset($params['withdraw']['madow_withdraw_enable'])) { + $params['withdraw']['madow_withdraw_enable'] = intval($params['withdraw']['madow_withdraw_enable']); + } + if (isset($params['withdraw']['madow_charge_rate'])) { + $params['withdraw']['madow_charge_rate'] = max(0.0, floatval($params['withdraw']['madow_charge_rate'])); + } + if (isset($params['withdraw']['madow_min_amount'])) { + $params['withdraw']['madow_min_amount'] = max(0.0, floatval($params['withdraw']['madow_min_amount'])); + } + } + $configs = ShoproConfig::setConfigs('shop.recharge_withdraw', $params); + + // 双向同步合伙股东配置项,确保老服务读取与全链路向后兼容 + if (isset($params['withdraw']['madow_withdraw_enable'])) { + ShoproConfig::setConfigs('shop.commission', [ + 'partner_madow_withdraw_enable' => $params['withdraw']['madow_withdraw_enable'] + ]); + } + if (isset($params['withdraw']['madow_charge_rate'])) { + ShoproConfig::setConfigs('shop.commission', [ + 'partner_madow_withdraw_charge_rate' => $params['withdraw']['madow_charge_rate'] + ]); + } + if (isset($params['withdraw']['madow_min_amount'])) { + ShoproConfig::setConfigs('shop.commission', [ + 'partner_madow_withdraw_min' => $params['withdraw']['madow_min_amount'] + ]); + } + if ($configs && isset($configs['withdraw'])) { $configs['withdraw']['status'] = isset($configs['withdraw']['status']) ? intval($configs['withdraw']['status']) : (!empty($configs['withdraw']['methods']) ? 1 : 0); } diff --git a/application/admin/controller/shopro/Withdraw.php b/application/admin/controller/shopro/Withdraw.php index 4188c89..eedb2ea 100644 --- a/application/admin/controller/shopro/Withdraw.php +++ b/application/admin/controller/shopro/Withdraw.php @@ -19,7 +19,7 @@ class Withdraw extends Common { protected $logModel; - protected $noNeedRight = ['checkWechatTransferResult']; + protected $noNeedRight = ['checkWechatTransferResult', 'export']; public function _initialize() { @@ -36,6 +36,8 @@ class Withdraw extends Common public function index() { if (!$this->request->isAjax()) { + $exportConfig = (new \addons\shopro\library\Export())->getConfig(); + $this->assignconfig("save_type", $exportConfig['save_type'] ?? 'download'); return $this->view->fetch(); } @@ -45,6 +47,140 @@ class Withdraw extends Common } + /** + * 导出提现管理订单台账 + */ + public function export() + { + $cellTitles = [ + 'id' => 'ID', + 'withdraw_sn' => '商户单号', + 'user_nickname' => '申请用户', + 'user_mobile' => '用户手机号', + 'asset_type' => '提现资产', + 'amount' => '提现金额/换算市值(元)', + 'paid_fee' => '实际到账(元)', + 'charge_rate_format' => '费率', + 'charge_fee' => '手续费(元)', + 'withdraw_type_text' => '提现方式', + 'payee_name' => '真实姓名', + 'bank_name' => '开户行', + 'card_no' => '银行卡号/收款账号', + 'asset_detail' => '资产折算明细', + 'status_text' => '状态', + 'createtime' => '申请时间', + 'updatetime' => '操作时间', + ]; + + $total = $this->model->sheepFilter()->count(); + if ($total <= 0) { + $this->error('导出数据为空'); + } + + $export = new \addons\shopro\library\Export(); + $params = [ + 'file_name' => '提现管理台账', + 'cell_titles' => $cellTitles, + 'total' => $total, + 'is_sub_cell' => false, + ]; + + $totalAmount = 0; + $totalPaidFee = 0; + $totalChargeFee = 0; + + $result = $export->export($params, function ($pages) use (&$totalAmount, &$totalPaidFee, &$totalChargeFee, $total) { + $datas = $this->model->sheepFilter()->with(['user']) + ->limit((($pages['page'] - 1) * $pages['list_rows']), $pages['list_rows']) + ->select(); + + $newDatas = []; + foreach ($datas as $withdraw) { + $user = $withdraw['user'] ?? null; + $displayInfo = $withdraw['withdraw_info_display'] ?? ($withdraw['withdraw_info'] ?? []); + + // 收款账户信息 + $payeeName = $displayInfo['真实姓名'] ?? ($displayInfo['姓名'] ?? ($displayInfo['微信用户'] ?? '')); + $bankName = $displayInfo['开户行'] ?? ($displayInfo['开户银行'] ?? ''); + $cardNo = $displayInfo['银行卡号'] ?? ($displayInfo['卡号'] ?? ($displayInfo['支付宝账户'] ?? ($displayInfo['支付宝账号'] ?? ($displayInfo['微信ID'] ?? '')))); + if ($cardNo !== '') { + $cardNo = "\t" . $cardNo; + } + + // 提现资产类型 + $assetType = $withdraw['is_madow_withdraw'] ? 'DMEPA' : ($withdraw['is_money_withdraw'] ? '商城余额' : ($displayInfo['提现资产'] ?? '商城余额')); + + // 资产折算明细 + $assetDetailParts = []; + if (!empty($displayInfo['扣除DMEPA'])) { + $assetDetailParts[] = '扣除: ' . $displayInfo['扣除DMEPA']; + } + if (!empty($displayInfo['市值汇率'])) { + $assetDetailParts[] = $displayInfo['市值汇率']; + } + if (!empty($displayInfo['换算市值'])) { + $assetDetailParts[] = '市值: ' . $displayInfo['换算市值']; + } + $assetDetail = implode('; ', $assetDetailParts); + + $amount = floatval($withdraw['amount'] ?? 0); + $paidFee = floatval($withdraw['paid_fee'] ?? 0) > 0 ? floatval($withdraw['paid_fee']) : floatval($withdraw['real_amount'] ?? $amount); + $chargeFee = floatval($withdraw['charge_fee'] ?? 0); + + $totalAmount = function_exists('bcadd') ? bcadd((string)$totalAmount, (string)$amount, 2) : ($totalAmount + $amount); + $totalPaidFee = function_exists('bcadd') ? bcadd((string)$totalPaidFee, (string)$paidFee, 2) : ($totalPaidFee + $paidFee); + $totalChargeFee = function_exists('bcadd') ? bcadd((string)$totalChargeFee, (string)$chargeFee, 2) : ($totalChargeFee + $chargeFee); + + $newDatas[] = [ + 'id' => $withdraw['id'], + 'withdraw_sn' => "\t" . (string)($withdraw['withdraw_sn'] ?? ''), + 'user_nickname' => $user['nickname'] ?? ('用户 ' . $withdraw['user_id']), + 'user_mobile' => "\t" . (string)($user['mobile'] ?? ''), + 'asset_type' => $assetType, + 'amount' => number_format($amount, 2, '.', ''), + 'paid_fee' => number_format($paidFee, 2, '.', ''), + 'charge_rate_format' => $withdraw['charge_rate_format'] ?? '0.0%', + 'charge_fee' => number_format($chargeFee, 2, '.', ''), + 'withdraw_type_text' => $withdraw['withdraw_type_text'] ?? '-', + 'payee_name' => $payeeName ?: '-', + 'bank_name' => $bankName ?: '-', + 'card_no' => $cardNo ?: '-', + 'asset_detail' => $assetDetail ?: '-', + 'status_text' => $withdraw['status_text'] ?? '-', + 'createtime' => $withdraw['createtime'] ?? '-', + 'updatetime' => $withdraw['updatetime'] ?? '-', + ]; + } + + if ($pages['is_last_page']) { + $newDatas[] = [ + 'id' => '合计: 共 ' . $total . ' 条记录', + 'withdraw_sn' => '', + 'user_nickname' => '', + 'user_mobile' => '', + 'asset_type' => '', + 'amount' => number_format((float)$totalAmount, 2, '.', ''), + 'paid_fee' => number_format((float)$totalPaidFee, 2, '.', ''), + 'charge_rate_format' => '', + 'charge_fee' => number_format((float)$totalChargeFee, 2, '.', ''), + 'withdraw_type_text' => '', + 'payee_name' => '', + 'bank_name' => '', + 'card_no' => '', + 'asset_detail' => '', + 'status_text' => '', + 'createtime' => '', + 'updatetime' => '', + ]; + } + + return $newDatas; + }); + + return $result; + } + + /** * 提现日志 */ diff --git a/application/admin/model/shopro/Config.php b/application/admin/model/shopro/Config.php index 82b2d34..9d922e7 100644 --- a/application/admin/model/shopro/Config.php +++ b/application/admin/model/shopro/Config.php @@ -128,7 +128,7 @@ class Config extends Common $config->save(); } } else { - // 自动补齐缺失的提现开关配置项,确保热更新无缝落地 + // 自动补齐缺失的提现配置项,确保热更新无缝落地 if ($code === 'shop.recharge_withdraw.withdraw.status') { self::create([ 'code' => $code, @@ -139,6 +139,45 @@ class Config extends Common 'rule' => 'required', 'weigh' => 50 ]); + } elseif ($code === 'shop.recharge_withdraw.withdraw.madow_withdraw_enable') { + self::create([ + 'code' => $code, + 'parent_code' => 'shop.recharge_withdraw.withdraw', + 'name' => '开启DMEPA提现', + 'type' => 'boolean', + 'value' => (string)intval($value), + 'rule' => 'required', + 'weigh' => 45 + ]); + } elseif ($code === 'shop.recharge_withdraw.withdraw.madow_charge_rate') { + self::create([ + 'code' => $code, + 'parent_code' => 'shop.recharge_withdraw.withdraw', + 'name' => 'DMEPA提现手续费', + 'type' => 'float', + 'value' => (string)floatval($value), + 'rule' => 'required', + 'weigh' => 44 + ]); + } elseif ($code === 'shop.recharge_withdraw.withdraw.madow_min_amount') { + self::create([ + 'code' => $code, + 'parent_code' => 'shop.recharge_withdraw.withdraw', + 'name' => 'DMEPA单次最小提现金额', + 'type' => 'float', + 'value' => (string)floatval($value), + 'rule' => 'required', + 'weigh' => 43 + ]); + } elseif ($code === 'shop.commission.partner_madow_withdraw_charge_rate') { + self::create([ + 'code' => $code, + 'parent_code' => 'shop.commission', + 'name' => 'DMEPA提现手续费率', + 'type' => 'number', + 'value' => (string)floatval($value), + 'weigh' => 85 + ]); } } } diff --git a/application/admin/model/shopro/Withdraw.php b/application/admin/model/shopro/Withdraw.php index ca701ce..25a0e4f 100644 --- a/application/admin/model/shopro/Withdraw.php +++ b/application/admin/model/shopro/Withdraw.php @@ -173,6 +173,17 @@ class Withdraw extends Common $valClean = trim(str_replace(['元', ' '], '', (string)$marketValue)); $display['换算市值'] = number_format((float)$valClean, 2, '.', '') . ' 元'; } + + // 手续费与预计到账 + $chargeFee = $data['charge_fee'] ?? ($this->charge_fee ?? ($info['charge_fee'] ?? 0)); + $chargeRate = $data['charge_rate'] ?? ($this->charge_rate ?? ($info['charge_rate'] ?? 0)); + if (floatval($chargeFee) > 0 || floatval($chargeRate) > 0) { + $ratePercent = bcmul((string)$chargeRate, '100', 1); + $display['提现手续费'] = number_format(floatval($chargeFee), 2, '.', '') . ' 元 (' . $ratePercent . '%)'; + } + $amount = $data['amount'] ?? ($this->amount ?? 0); + $real = bcsub((string)$amount, (string)$chargeFee, 2); + $display['预计到账'] = number_format(max(0, floatval($real)), 2, '.', '') . ' 元'; } elseif ($isMoney) { $display['提现资产'] = '商城余额'; $amount = $data['amount'] ?? ($this->amount ?? 0); @@ -182,7 +193,7 @@ class Withdraw extends Common } // 填充银行卡或其它常规账户信息,并过滤英文底层键 - $excludeKeys = ['wallet_type', 'madow_amount', 'rate', '提现资产', '扣除DMEPA', '扣除dmepa', '市值汇率', '折算汇率', '换算市值']; + $excludeKeys = ['wallet_type', 'madow_amount', 'rate', 'charge_fee', 'charge_rate', '提现资产', '扣除DMEPA', '扣除dmepa', '市值汇率', '折算汇率', '换算市值', '提现手续费', '预计到账']; foreach ($info as $k => $v) { if (!in_array($k, $excludeKeys)) { $display[$k] = $v; @@ -216,6 +227,6 @@ class Withdraw extends Common public function user() { - return $this->belongsTo(User::class, 'user_id', 'id')->field('id, nickname, avatar, total_consume'); + return $this->belongsTo(User::class, 'user_id', 'id')->field('id, nickname, mobile, avatar, total_consume'); } } diff --git a/application/admin/view/shopro/config/index.html b/application/admin/view/shopro/config/index.html index cccc4b5..b037169 100644 --- a/application/admin/view/shopro/config/index.html +++ b/application/admin/view/shopro/config/index.html @@ -646,6 +646,33 @@ + +
DMEPA 数字资产提现配置
+ +
+
+ +
+ {{ form.model.withdraw.madow_withdraw_enable == 1 ? '开启' : '关闭' }} +
+
+
+
开启后,用户端“我的DMEPA”页面将显示提现入口,支持持仓DMEPA按大盘实时市值提现到银行卡;关闭后隐藏提现入口并禁止提现。
+
+
+
+ + + + +
提现时从折算人民币到账金额中内扣手续费(如设置 5%,提现 100 元实际到账 95 元;填 0 为无手续费)
+
+ + + + +
每次 DMEPA 折算现金提现的单笔最低申请金额(元)
+
@@ -970,6 +997,12 @@
每次dmepa折合现金提现的最低申请金额(元)
+ + + + +
提现时从折算人民币到账金额中内扣手续费(如 5%,提现 100 元到账 95 元;填 0 为无手续费)
+
diff --git a/application/admin/view/shopro/withdraw/index.html b/application/admin/view/shopro/withdraw/index.html index be1a80d..5333071 100644 --- a/application/admin/view/shopro/withdraw/index.html +++ b/application/admin/view/shopro/withdraw/index.html @@ -33,6 +33,9 @@
+ {if $auth->check('shopro/withdraw/export') || $auth->check('shopro/withdraw/index')} + 导出 + {/if}
@@ -57,7 +60,7 @@ 换算市值: {{ scope.row.amount || '-' }}元
- 实际到账: {{ scope.row.paid_fee }}元 + 实际到账: {{ Number(scope.row.paid_fee) > 0 ? scope.row.paid_fee : (scope.row.real_amount || scope.row.amount) }}元