diff --git a/app/Admin/Forms/ShopWithdrawForm.php b/app/Admin/Forms/ShopWithdrawForm.php index 847bfab8..6118d79f 100644 --- a/app/Admin/Forms/ShopWithdrawForm.php +++ b/app/Admin/Forms/ShopWithdrawForm.php @@ -2,9 +2,13 @@ namespace App\Admin\Forms; +use App\Enums\BoolEnum; use App\Enums\WithdrawState; use App\Enums\WithdrawType; +use App\Model\Seller\Shop; +use App\Model\Seller\ShopFreeze; use App\Model\Seller\ShopWithdraw; +use App\User; use Dcat\Admin\Contracts\LazyRenderable; use Dcat\Admin\Traits\LazyWidget; use Dcat\Admin\Widgets\Form; @@ -36,6 +40,15 @@ class ShopWithdrawForm extends Form implements LazyRenderable $shopWithdraw->admin_remark = strval($admin_remark); $shopWithdraw->remark_at = date('Y-m-d H:i:s'); $shopWithdraw->save(); + + // 更改余额 + Shop::where('id', $shopWithdraw->shop_id) + ->update(['balance_freeze' => 0]); + // 解冻 + ShopFreeze::where('shop_id', $shopWithdraw->shop_id) + ->where('id', 'freeze_id') + ->update(['state' => BoolEnum::NO]); + return $this->response()->success("设置成功")->refresh(); }