get('pay_channel'); foreach ($payChannels as $key => $value) { if (in_array($payChannel, $value)) { return $key; } } return ''; } /** * 生成套餐编号 * * @param int $type * @param int $carrierOperator * @param int $flow * @param int $serviceMonths * @return string */ public static function generatePackageSn($type, $carrierOperator, $flow, $reset_months, $serviceMonths) { $typeSN = ['BS', 'RW', 'RP', 'FP', 'OP', 'AP']; $carrierOperatorSN = ['LT', 'YD', 'DX', 'QW']; return "{$typeSN[$type]}_{$carrierOperatorSN[$carrierOperator]}_{$flow}_{$reset_months}_{$serviceMonths}"; } }