diff --git a/app/Http/Controllers/Api/WxpayController.php b/app/Http/Controllers/Api/WxpayController.php index 4d2202f..faf7db6 100644 --- a/app/Http/Controllers/Api/WxpayController.php +++ b/app/Http/Controllers/Api/WxpayController.php @@ -14,6 +14,7 @@ use App\Models\IndustryProduct; use App\Models\Order; use App\Models\Product; use App\Models\SettledOrder; +use App\Models\Supplier; use App\Models\UserMoneyLog; use EasyWeChat\Factory; use EasyWeChat\Kernel\Exceptions\Exception; @@ -338,6 +339,11 @@ class WxpayController $order->timeout = null; $order->save(); + //给供应商加钱 + $supplier = Supplier::find($order->supplier_id); + $supplier->balance = DB::raw('`balance` + ' . $money); + $supplier->save(); + //资金流水 IndustryPayLog::create([ 'agent_id' => $order->agent_id,