diff --git a/app/api/controller/Dealer.php b/app/api/controller/Dealer.php index a49659df..951ad334 100644 --- a/app/api/controller/Dealer.php +++ b/app/api/controller/Dealer.php @@ -28,7 +28,7 @@ class Dealer extends Controller { // 当前用户信息 /* @var UserModel $user */ - private UserModel $user; + public $user; // 当前分销商信息 private ?DealerUserModel $dealer; diff --git a/app/api/controller/dealer/Withdraw.php b/app/api/controller/dealer/Withdraw.php index 7315cb77..75210f21 100644 --- a/app/api/controller/dealer/Withdraw.php +++ b/app/api/controller/dealer/Withdraw.php @@ -57,7 +57,7 @@ class Withdraw extends Controller // 提交提现申请 $model = new WithdrawModel; $data = $this->request->post(); - if ($model->submit($dealer, $data)) { + if ($model->submit($dealer, $data['from'])) { return $this->renderSuccess([], '提现申请已提交成功,请等待审核'); } return $this->renderError($model->getError() ?: '提交失败'); diff --git a/app/api/model/Setting.php b/app/api/model/Setting.php index a81bd165..63c6d651 100644 --- a/app/api/model/Setting.php +++ b/app/api/model/Setting.php @@ -55,7 +55,8 @@ class Setting extends SettingModel */ public static function getFinanceCommission() { - return static::getItem(SettingEnum::TRADE)['finance_process']; + $return = empty(static::getItem(SettingEnum::TRADE)['finance_process'])?'':static::getItem(SettingEnum::TRADE)['finance_process']; + return $return; } /** diff --git a/app/api/model/dealer/Withdraw.php b/app/api/model/dealer/Withdraw.php index a40c2c99..36ece79e 100644 --- a/app/api/model/dealer/Withdraw.php +++ b/app/api/model/dealer/Withdraw.php @@ -76,7 +76,7 @@ class Withdraw extends WithdrawModel //手续费 if (empty($data['is_invoice'])) { $commission = \app\api\model\Setting::getFinanceCommission(); - if (empty($commission)) { + if (!empty($commission)) { $data['commission_price'] = bcmath($data['money'], $commission / 100, 2); } }