generate_sn(RechargeOrder::class, 'sn'), 'order_terminal' => $params['terminal'], 'user_id' => $params['user_id'], 'pay_status' => PayEnum::UNPAID, 'order_amount' => $params['money'], ]; $order = RechargeOrder::create($data); return [ 'order_id' => (int)$order['id'], 'from' => 'recharge' ]; } catch (\Exception $e) { self::setError($e->getMessage()); return false; } } /** * @notes 充值配置 * @param $userId * @return array * @author 段誉 * @date 2023/2/24 16:56 */ public static function config($userId) { $userMoney = User::where(['id' => $userId])->value('user_money'); $minAmount = ConfigService::get('recharge', 'min_amount', 0); $status = ConfigService::get('recharge', 'status', 0); return [ 'status' => $status, 'min_amount' => $minAmount, 'user_money' => $userMoney, ]; } }