getOrderInfo(['order_id' => $order_id]); if(empty($refill_info)) { return self::card_key_info($order); } else { return self::refill_info($refill_info); } } private static function refill_info($refill_info) { if(empty($refill_info)) { return []; } else { $ret['接收卡'] = $refill_info['card_no']; $ret['卡类别'] = mtopcard\scard_type($refill_info['card_type']); $ret['身份证号码'] = $refill_info['idcard']; $ret['身份证姓名'] = $refill_info['card_name']; // $ret['卡号'] = $item['card_no']; // $ret['卡密'] = $item['card_key']; return $ret; } } private static function card_key_info($order) { global $config; $handlers = $config['vgoods_handlers']; $goods_id = $order['goods_id']; if(array_key_exists($goods_id,$handlers)) { $handler = $handlers[$goods_id]; if($handler['type'] == 'oil_card' || $handler['type'] == 'phone_card') { $mod_card = Model('card_key'); $item = $mod_card->where(['order_id' => $order['order_id']])->find(); if(!empty($item)) { $ret = []; $ret['接收卡'] = $item['receive_card_no']; if($handler['type'] == 'oil_card') { $extra_info = json_decode($order['extra_info'],true); $ret['绑定手机号'] = $extra_info['input']['phone_no'] ?? ''; } $ret['卡类别'] = mtopcard\scard_type($item['receive_card_type']); $ret['卡号'] = $item['card_no']; $ret['卡密'] = $item['card_key']; return $ret; } } elseif($handler['type'] == 'member_card') { return []; } else { return []; } } else { return []; } } //取消虚拟订单时的状态 public static function unfreeze_extra($order) { global $config; $handlers = $config['vgoods_handlers']; $goods_id = $order['goods_id']; if(array_key_exists($goods_id,$handlers)) { $handler = $handlers[$goods_id]; if($handler['type'] == 'oil_card' || $handler['type'] == 'phone_card') { $mod_card = Model('card_key'); $item = $mod_card->where(['order_id' => $order['order_id']])->find(); if(!empty($item)) { $card_id = $item['card_id']; $mod_card->reuse($card_id); } } } } }