fix(wallet): 放开未入驻账号查看提现规则与新增withdrawRules公开接口
这个提交包含在:
@@ -19,7 +19,7 @@ use think\Db;
|
||||
*/
|
||||
class Master extends MasterBase
|
||||
{
|
||||
protected $noNeedLogin = ['hall', 'orderDetail', 'resolveLocation'];
|
||||
protected $noNeedLogin = ['hall', 'orderDetail', 'resolveLocation', 'withdrawRules'];
|
||||
|
||||
/**
|
||||
* 师傅入驻申请
|
||||
@@ -1315,11 +1315,33 @@ class Master extends MasterBase
|
||||
}
|
||||
|
||||
/**
|
||||
* 收入概览(含待确认收款的微信商家转账单与提现申请记录)
|
||||
* 公开获取师傅提现规则配置(免入驻认证即可查看真实后台配置,供钱包页展示)
|
||||
*/
|
||||
public function withdrawRules()
|
||||
{
|
||||
$master = $this->masterInfo();
|
||||
$withdrawConfig = FinanceConfigService::buildMasterWithdrawClientPayload($master ?: ['id' => 0]);
|
||||
$limits = PaymentService::getWithdrawLimits();
|
||||
$limits['today_used'] = $withdrawConfig['today_amount'];
|
||||
$limits['today_remain'] = $withdrawConfig['remain_daily_amount'] >= 0
|
||||
? $withdrawConfig['remain_daily_amount']
|
||||
: (float)$limits['daily_user_limit'];
|
||||
|
||||
$this->success('', [
|
||||
'withdraw_config' => $withdrawConfig,
|
||||
'withdraw_limits' => $limits,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 收入概览(含待确认收款的微信商家转账单与提现申请记录;已登录即可查看余额与提现规则)
|
||||
*/
|
||||
public function income()
|
||||
{
|
||||
$master = $this->requireMasterProfile();
|
||||
$master = $this->masterInfo();
|
||||
if (!$master) {
|
||||
$this->error(__('Please login first'), null, 401);
|
||||
}
|
||||
|
||||
// 顺带轻量同步最新 3 笔处理中的微信转账提现单(如师傅上次已确认收款但未回调或超时自动退回)
|
||||
$syncCandidates = Db::name('withdraw')
|
||||
|
||||
@@ -288,6 +288,12 @@ class FinanceConfigService
|
||||
*/
|
||||
public static function getMasterTodayWithdrawStats(int $masterId): array
|
||||
{
|
||||
if ($masterId <= 0) {
|
||||
return [
|
||||
'today_count' => 0,
|
||||
'today_amount' => 0.00,
|
||||
];
|
||||
}
|
||||
$todayStart = strtotime(date('Y-m-d 00:00:00'));
|
||||
$rows = Db::name('withdraw')
|
||||
->field('amount')
|
||||
|
||||
在新工单中引用
屏蔽一个用户