generate_sn(RechargeOrder::class, 'sn'), 'order_terminal' => $params['terminal'], 'user_id' => $params['user_id'], 'pay_status' => PayEnum::UNPAID, 'order_amount' => $params['money'], ]; if(isset($params['task_id']) &&$params['task_id']>0){ $data['extend']=json_encode(['task_id'=>$params['task_id'],'type'=>1]); } if(isset($params['type']) &&$params['type']==300){ $data['change_type']=300; } $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, ]; } }