diff --git a/app/Admin/Forms/Settings/Dealer.php b/app/Admin/Forms/Settings/Dealer.php index 376be254..06142963 100644 --- a/app/Admin/Forms/Settings/Dealer.php +++ b/app/Admin/Forms/Settings/Dealer.php @@ -38,6 +38,8 @@ class Dealer extends Form */ public function form() { + $this->switch('wxpay_switch', '微信支付'); + $this->currency('fee_rate', '手续费比例(百分比)')->symbol('%'); $this->currency('fee_rate', '手续费比例(百分比)')->symbol('%'); $this->number('withdraw_threshold_amount', '起提金额(元)'); $this->currency('withdraw_fee_rate', '提现费率')->symbol('%'); @@ -137,6 +139,7 @@ class Dealer extends Form { $dealerSettings = (array) Setting::where('key', 'dealer')->value('value'); return [ + 'wxpay_switch'=> $dealerSettings['wxpay_switch'] ?? 1, 'fee_rate'=> $dealerSettings['fee_rate'] ?? '', 'withdraw_threshold_amount'=> $dealerSettings['withdraw_threshold_amount'] ?? 0, 'withdraw_fee_rate'=> $dealerSettings['withdraw_fee_rate'] ?? 0, diff --git a/app/Endpoint/Api/Http/Controllers/Dealer/ConfigurationController.php b/app/Endpoint/Api/Http/Controllers/Dealer/ConfigurationController.php new file mode 100644 index 00000000..644a9cec --- /dev/null +++ b/app/Endpoint/Api/Http/Controllers/Dealer/ConfigurationController.php @@ -0,0 +1,16 @@ +json([ + 'wxpay_switch' => app_settings('dealer.wxpay_switch', 0), + ]); + } +} diff --git a/app/Endpoint/Api/routes.php b/app/Endpoint/Api/routes.php index 3fc73b62..3b3a8043 100644 --- a/app/Endpoint/Api/routes.php +++ b/app/Endpoint/Api/routes.php @@ -211,6 +211,8 @@ Route::group([ }); + // 批零配置 + Route::get('dealer/configurations', [Dealer\ConfigurationController::class, 'index']); //商品列表 Route::get('/dealer/products', [Dealer\ProductController::class, 'index']); //商品详情