isEmpty() || $shop['money'] < $order['order_amount']) { throw new \Exception('余额不足'); } //扣除余额 Shop::update([ 'money' => ['dec', $order['order_amount']] ], ['id' => $shop['id']]); //余额流水 ShopAccountLogLogic::add( $shop->id, ShopAccountLogEnum::DEPOSIT, ShopAccountLogEnum::RECHARGE_INC_DEPOSIT, 1, $order['order_amount'], $order['sn'], ); return [ 'pay_way' => PayEnum::BALANCE_PAY ]; } catch (\Exception $e) { $this->setError($e->getMessage()); return false; } } }