where('status', 0)->find(); if ($partake){ $out = Out::where('id', $partake['out_id'])->find(); if ($item['pay_price'] >= $out['number']){ User::where('uid', $item['uid'])->dec('pay_price', $out['number'])->update(); User::where('uid', $item['uid'])->inc('use_price', $out['number'])->update(); $partake['status'] = 1; $partake['money'] = $out['number']; $partake->save(); } } } } }