product = Product::find($order->product_id); } protected function handlePayProcess() { $charge = $this->product->price * 100; $given = $this->product->given; $uid = $this->order->uid; User::where('id', $uid)->update( [ 'balance' => DB::raw('balance+' . ($charge + $given)), 'charge_balance' => DB::raw('charge_balance+' . $charge), 'reward_balance' => DB::raw('reward_balance+' . $given), ] ); try{ $job = (new UserBalanceJob($uid,1,$charge,1,'充值'))->onConnection('rabbitmq')->delay(0)->onQueue('user_balance_job'); dispatch($job); if($given){ $job = (new UserBalanceJob($uid,2,$given,2,'充送'))->onConnection('rabbitmq')->delay(0)->onQueue('user_balance_job'); dispatch($job); } }catch (\Exception $e){ myLog('UserBalanceJob')->info($e); } } }