فهرست منبع

add virtual order cancel and success

stanley-king 4 سال پیش
والد
کامیت
05432c52f1

+ 4 - 1
data/config/dev/vgoods.ini.php

@@ -29,6 +29,8 @@ $oil_params = ['type' => 'oil_card', 'order_method' => 'OnAssignOilCard',
                                      'cancel_method' => 'OnOilCancel',
                                      'input_params' => ['card_no','card_type']];
 $handlers[6218] = $oil_params;
+$handlers[6219] = $oil_params;
+
 
 
 #phone card
@@ -38,6 +40,7 @@ $phone_card_prams = ['type' => 'phone_card', 'order_method' => 'OnAssignPhoneCar
                                              'paid_method' => 'OnPhonePaidSuccess',
                                              'cancel_method' => 'OnPhoneCancel',
                                              'input_params' => ['card_no','card_type']];
-$handlers[6219] = $phone_card_prams;
+$handlers[6220] = $phone_card_prams;
+$handlers[6221] = $phone_card_prams;
 
 $config['vgoods_handlers'] = $handlers;

+ 5 - 7
data/logic/queue.logic.php

@@ -923,9 +923,9 @@ class queueLogic
 
         $extra_info = json_decode($order['extra_info'],true);
         $card_no   = $extra_info['input']['card_no'];
-        $card_type = $extra_info['input']['card_type'];
+        $card_type = mtopcard\topcard_type($extra_info['input']['card_type']);
 
-        $ret = mtopcard\cards_helper::reserve(mtopcard\OilCardPaper,$amount,$member_id,$card_no,$card_type,$member_id,$order_id);
+        $ret = mtopcard\cards_helper::reserve(mtopcard\OilCardPaper,$amount,$member_id,$card_no,$card_type,$order_id);
         return $ret;
     }
 
@@ -936,10 +936,10 @@ class queueLogic
         $order_id = $order['order_id'];
 
         $extra_info = json_decode($order['extra_info'],true);
-        $card_no = $extra_info['card_no'];
-        $card_type = $extra_info['card_type'];
+        $card_no   = $extra_info['input']['card_no'];
+        $card_type = mtopcard\topcard_type($extra_info['input']['card_type']);
 
-        $ret = mtopcard\cards_helper::reserve(mtopcard\PhoneCardPaper,$amount,$member_id,$card_no,$card_type,$member_id,$order_id);
+        $ret = mtopcard\cards_helper::reserve(mtopcard\PhoneCardPaper,$amount,$member_id,$card_no,$card_type,$order_id);
         return $ret;
     }
 
@@ -968,8 +968,6 @@ class queueLogic
         return callback(true);
     }
 
-
-
     //支付成功完成会员卡操作.
     public function OnMCardPaidSuccess($params)
     {

+ 5 - 0
data/logic/vr_order.logic.php

@@ -5,6 +5,8 @@
 
  */
 defined('InShopNC') or exit('Access Invalid!');
+require_once(BASE_HELPER_PATH . '/vrorder_helper.php');
+
 
 class vr_orderLogic
 {
@@ -54,6 +56,9 @@ class vr_orderLogic
                 $model_pd->changePd('order_cancel', $data_pd);
             }
 
+            //解锁虚拟订单中对应的充值卡商品
+            vrorder_helper::unfreeze_extra($order_info);
+
             //更新订单信息
             $update_order = [
                 'order_state' => ORDER_STATE_CANCEL,

+ 4 - 0
data/model/vr_order.model.php

@@ -306,6 +306,10 @@ class vr_orderModel extends Model
             case 'buyer_cancel':
                 $state = $order_info['order_state'] == ORDER_STATE_NEW;
                 break;
+            //商家
+            case 'store_receive':
+                $state = $order_info['order_state'] == ORDER_STATE_PAY;
+                break;
 
             //商家取消订单
             case 'store_cancel':

+ 1 - 2
helper/mtopcard/mtopcard.php

@@ -54,7 +54,6 @@ function topcard_type($str_type)
     }
 }
 
-
 function scard_type($card_type)
 {
     if($card_type == PetroChinaCard) { //中石油
@@ -83,8 +82,8 @@ function priority_cards($member_id, $page_type)
     }
     else {
         $types = [PhoneCard];
-
     }
+
     $user_cards = new user_topcards($member_id);
     return $user_cards->priority_cards($types);
 }

+ 67 - 0
helper/vrorder_helper.php

@@ -0,0 +1,67 @@
+<?php
+
+require_once(BASE_HELPER_PATH . '/mcard/mcard.php');
+require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
+
+class vrorder_helper
+{
+    public static function extend_order_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['value']['receive_card'] = $item['receive_card_no'];
+//                    $ret['value']['receive_card_type'] = mtopcard\scard_type($item['receive_card_type']);
+//                    $ret['value']['card_no'] = $item['card_no'];
+//                    $ret['value']['card_key'] = $item['card_key'];
+//                    $ret['desc'] = ['receive_card' => '接收卡','receive_card_type' =>'卡类别', 'card_no'=> '卡号','card_key'=>'卡密'];
+                    $ret['接收卡'] = $item['receive_card_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);
+                }
+            }
+        }
+    }
+}

+ 2 - 5
mobile/control/member_vorder.php

@@ -78,7 +78,6 @@ class member_vorderControl extends mbMemberControl
             if($order == false) {
                 $order = null;
             }
-
             return self::outsuccess(["act_type" => $act_type,"order_id" => $order_id, "order" => $order]);
         }
         else {
@@ -170,10 +169,8 @@ class member_vorderControl extends mbMemberControl
         output_data(['code_list' => $code_list]);
     }
 
-
-
-
-    public function upload_certOp(){
+    public function upload_certOp()
+    {
         $member_id = session_helper::memberid();
 	    $order_sn = $_GET['order_sn'];
 	    $phone = $_GET['phone'];

+ 69 - 42
shop/control/store_vr_order.php

@@ -8,7 +8,10 @@
 
 
 defined('InShopNC') or exit('Access Invalid!');
-class store_vr_orderControl extends BaseSellerControl {
+require_once(BASE_HELPER_PATH . '/vrorder_helper.php');
+
+class store_vr_orderControl extends BaseSellerControl
+{
     public function __construct() {
         parent::__construct();
         Language::read('member_store_index');
@@ -21,7 +24,7 @@ class store_vr_orderControl extends BaseSellerControl {
 	public function indexOp() {
         $model_vr_order = Model('vr_order');
 
-        $condition = array();
+        $condition = [];
         $condition['store_id'] = $_SESSION['store_id'];
         if ($_GET['order_sn'] != '') {
             $condition['order_sn'] = $_GET['order_sn'];
@@ -29,10 +32,10 @@ class store_vr_orderControl extends BaseSellerControl {
         if ($_GET['buyer_name'] != '') {
             $condition['buyer_name'] = $_GET['buyer_name'];
         }
-        $allow_state_array = array('state_new','state_pay','state_success','state_cancel');
+        $allow_state_array = ['state_new','state_pay','state_success','state_cancel'];
         if (in_array($_GET['state_type'],$allow_state_array)) {
             $condition['order_state'] = str_replace($allow_state_array,
-                    array(ORDER_STATE_NEW,ORDER_STATE_PAY,ORDER_STATE_SUCCESS,ORDER_STATE_CANCEL), $_GET['state_type']);
+                    [ORDER_STATE_NEW,ORDER_STATE_PAY,ORDER_STATE_SUCCESS,ORDER_STATE_CANCEL], $_GET['state_type']);
         } else {
             $_GET['state_type'] = 'store_order';
         }
@@ -41,11 +44,11 @@ class store_vr_orderControl extends BaseSellerControl {
         $start_unixtime = $if_start_date ? strtotime($_GET['query_start_date']) : null;
         $end_unixtime = $if_end_date ? strtotime($_GET['query_end_date']): null;
         if ($start_unixtime || $end_unixtime) {
-            $condition['add_time'] = array('time',array($start_unixtime,$end_unixtime));
+            $condition['add_time'] = ['time', [$start_unixtime,$end_unixtime]];
         }
 
         if ($_GET['skip_off'] == 1) {
-            $condition['order_state'] = array('neq',ORDER_STATE_CANCEL);
+            $condition['order_state'] = ['neq',ORDER_STATE_CANCEL];
         }
 
 	    $order_list = $model_vr_order->getOrderList($condition, 20, '*', 'order_id desc');
@@ -75,7 +78,7 @@ class store_vr_orderControl extends BaseSellerControl {
 	        showMessage(Language::get('wrong_argument'),'','html','error');
 	    }
 	    $model_vr_order = Model('vr_order');
-	    $condition = array();
+	    $condition = [];
         $condition['order_id'] = $order_id;
         $condition['store_id'] = $_SESSION['store_id'];
 	    $order_info = $model_vr_order->getOrderInfo($condition);
@@ -83,8 +86,12 @@ class store_vr_orderControl extends BaseSellerControl {
 	        showMessage(Language::get('store_order_none_exist'),'','html','error');
 	    }
 
+	    //显示虚拟订单附加信息
+        $extra_info = vrorder_helper::extend_order_info($order_info);
+        $order_info['extend_order_info'] = $extra_info;
+
         //取兑换码列表
-        $vr_code_list = $model_vr_order->getOrderCodeList(array('order_id' => $order_info['order_id']));
+        $vr_code_list = $model_vr_order->getOrderCodeList(['order_id' => $order_info['order_id']]);
         $order_info['extend_vr_order_code'] = $vr_code_list;
 
         //显示取消订单
@@ -95,13 +102,10 @@ class store_vr_orderControl extends BaseSellerControl {
 
         //显示系统自动取消订单日期
         if ($order_info['order_state'] == ORDER_STATE_NEW) {
-            //$order_info['order_cancel_day'] = $order_info['add_time'] + ORDER_AUTO_CANCEL_DAY * 24 * 3600;
-			// by abc.com
-			$order_info['order_cancel_day'] = $order_info['add_time'] + ORDER_AUTO_CANCEL_DAY + 3 * 24 * 3600;
+            $order_info['order_cancel_day'] = $order_info['add_time'] + ORDER_AUTO_CANCEL_DAY * 24 * 3600;
         }
 
         Tpl::output('order_info',$order_info);
-
 		Tpl::showpage('store_vr_order.show');
 	}
 
@@ -111,13 +115,20 @@ class store_vr_orderControl extends BaseSellerControl {
 	 */
 	public function change_stateOp() {
 	    $model_vr_order = Model('vr_order');
-	    $condition = array();
+	    $condition = [];
 	    $condition['order_id'] = intval($_GET['order_id']);
 	    $condition['store_id'] = $_SESSION['store_id'];
 	    $order_info	= $model_vr_order->getOrderInfo($condition);
+        $extra_info = vrorder_helper::extend_order_info($order_info);
+        $order_info['extend_order_info'] = $extra_info;
+
 	    if ($_GET['state_type'] == 'order_cancel') {
 	        $result = $this->_order_cancel($order_info,$_POST);
 	    }
+        elseif ($_GET['state_type'] == 'order_success') {
+            $result = $this->_order_success($order_info,$_POST);
+        }
+
 	    if(!$result['state']) {
 	        showDialog($result['msg'],'','error');
 	    } else {
@@ -133,7 +144,7 @@ class store_vr_orderControl extends BaseSellerControl {
 	 */
 	private function _order_cancel($order_info, $post) {
 	    if(!chksubmit()) {
-	        Tpl::output('order_id',$order_info['order_id']);
+            Tpl::output('order_id',$order_info['order_id']);
 	        Tpl::output('order_info',$order_info);
 	        Tpl::showpage('store_vr_order.cancel','null_layout');
 	        exit();
@@ -149,6 +160,24 @@ class store_vr_orderControl extends BaseSellerControl {
 	    }
 	}
 
+    private function _order_success($order_info, $post) {
+        if(!chksubmit()) {
+            Tpl::output('order_id',$order_info['order_id']);
+            Tpl::output('order_info',$order_info);
+            Tpl::showpage('store_vr_order.receive','null_layout');
+            exit();
+        } else {
+            $model_vr_order = Model('vr_order');
+            $logic_vr_order = Logic('vr_order');
+            $if_allow = $model_vr_order->getOrderOperateState('store_receive',$order_info);
+            if (!$if_allow) {
+                return callback(false,'无权操作');
+            }
+            $msg = $post['state_info1'] != '' ? $post['state_info1'] : $post['state_info'];
+            return $logic_vr_order->changeOrderStateSuccess($order_info['order_id']);
+        }
+    }
+
 	public function exchangeOp() {
 	    $data = $this->_exchange();
 	    exit(json_encode($data));
@@ -160,43 +189,43 @@ class store_vr_orderControl extends BaseSellerControl {
     private function _exchange() {
         if (chksubmit()) {
             if (!preg_match('/^[a-zA-Z0-9]{15,18}$/',$_GET['vr_code'])) {
-                return array('error' => '兑换码格式错误,请重新输入');
+                return ['error' => '兑换码格式错误,请重新输入'];
             }
             $model_vr_order = Model('vr_order');
-            $vr_code_info = $model_vr_order->getOrderCodeInfo(array('vr_code' => $_GET['vr_code']));
+            $vr_code_info = $model_vr_order->getOrderCodeInfo(['vr_code' => $_GET['vr_code']]);
             if (empty($vr_code_info) || $vr_code_info['store_id'] != $_SESSION['store_id']) {
-                return array('error' => '该兑换码不存在');
+                return ['error' => '该兑换码不存在'];
             }
             if ($vr_code_info['vr_state'] == '1') {
-                return array('error' => '该兑换码已被使用');
+                return ['error' => '该兑换码已被使用'];
             }
             if ($vr_code_info['vr_indate'] < TIMESTAMP) {
-                return array('error' => '该兑换码已过期,使用截止日期为: '.date('Y-m-d H:i:s',$vr_code_info['vr_indate']));
+                return ['error' => '该兑换码已过期,使用截止日期为: '.date('Y-m-d H:i:s',$vr_code_info['vr_indate'])];
             }
             if ($vr_code_info['refund_lock'] > 0) {//退款锁定状态:0为正常,1为锁定(待审核),2为同意
-                return array('error' => '该兑换码已申请退款,不能使用');
+                return ['error' => '该兑换码已申请退款,不能使用'];
             }
 
             //更新兑换码状态
-            $update = array();
+            $update = [];
             $update['vr_state'] = 1;
             $update['vr_usetime'] = TIMESTAMP;
-            $update = $model_vr_order->editOrderCode($update, array('vr_code' => $_GET['vr_code']));
+            $update = $model_vr_order->editOrderCode($update, ['vr_code' => $_GET['vr_code']]);
 
             //如果全部兑换完成,更新订单状态
             Logic('vr_order')->changeOrderStateSuccess($vr_code_info['order_id']);
 
             if ($update) {
                 //取得返回信息
-                $order_info = $model_vr_order->getOrderInfo(array('order_id'=>$vr_code_info['order_id']));
+                $order_info = $model_vr_order->getOrderInfo(['order_id'=>$vr_code_info['order_id']]);
                 if ($order_info['use_state'] == '0') {
-                    $model_vr_order->editOrder(array('use_state' => 1), array('order_id' => $vr_code_info['order_id']));
+                    $model_vr_order->editOrder(['use_state' => 1], ['order_id' => $vr_code_info['order_id']]);
                 }
                 $order_info['img_60'] = thumb($order_info,60);
                 $order_info['img_240'] = thumb($order_info,240);
-                $order_info['goods_url'] = urlShop('goods','index',array('goods_id' => $order_info['goods_id']));
-                $order_info['order_url'] = urlShop('store_vr_order','show_order',array('order_id' => $order_info['order_id']));
-                return array('error'=>'', 'data' => $order_info);
+                $order_info['goods_url'] = urlShop('goods','index', ['goods_id' => $order_info['goods_id']]);
+                $order_info['order_url'] = urlShop('store_vr_order','show_order', ['order_id' => $order_info['order_id']]);
+                return ['error'=>'', 'data' => $order_info];
             }
 
         } else {
@@ -216,23 +245,21 @@ class store_vr_orderControl extends BaseSellerControl {
         Language::read('member_layout');
         switch ($menu_type) {
         	case 'list':
-            $menu_array = array(
-            array('menu_key'=>'store_order',		'menu_name'=>Language::get('nc_member_path_all_order'),	'menu_url'=>'index.php?act=store_vr_order'),
-            array('menu_key'=>'state_new',			'menu_name'=>Language::get('nc_member_path_wait_pay'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_new'),
-            array('menu_key'=>'state_pay',			'menu_name'=>'已付款',	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_pay'),
-            array('menu_key'=>'state_success',		'menu_name'=>Language::get('nc_member_path_finished'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_success'),
-            array('menu_key'=>'state_cancel',		'menu_name'=>Language::get('nc_member_path_canceled'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_cancel'),
-            );
+            $menu_array = [
+            ['menu_key'=>'store_order',		'menu_name'=>Language::get('nc_member_path_all_order'),	'menu_url'=>'index.php?act=store_vr_order'],
+            ['menu_key'=>'state_new',			'menu_name'=>Language::get('nc_member_path_wait_pay'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_new'],
+            ['menu_key'=>'state_pay',			'menu_name'=>'已付款',	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_pay'],
+            ['menu_key'=>'state_success',		'menu_name'=>Language::get('nc_member_path_finished'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_success'],
+            ['menu_key'=>'state_cancel',		'menu_name'=>Language::get('nc_member_path_canceled'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_cancel'],];
             break;
             case 'exchange':
-                $menu_array = array(
-                array('menu_key'=>'store_order',		'menu_name'=>Language::get('nc_member_path_all_order'),	'menu_url'=>'index.php?act=store_vr_order'),
-                array('menu_key'=>'state_new',			'menu_name'=>Language::get('nc_member_path_wait_pay'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_new'),
-                array('menu_key'=>'state_pay',			'menu_name'=>'已付款',	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_pay'),
-                array('menu_key'=>'state_success',		'menu_name'=>Language::get('nc_member_path_finished'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_success'),
-                array('menu_key'=>'state_cancel',		'menu_name'=>Language::get('nc_member_path_canceled'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_cancel'),
-                array('menu_key'=>'exchange',		    'menu_name'=>'兑换码兑换',	'menu_url'=>'index.php?act=store_vr_order&op=exchange'),
-                );
+                $menu_array = [
+                ['menu_key'=>'store_order',		'menu_name'=>Language::get('nc_member_path_all_order'),	'menu_url'=>'index.php?act=store_vr_order'],
+                ['menu_key'=>'state_new',			'menu_name'=>Language::get('nc_member_path_wait_pay'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_new'],
+                ['menu_key'=>'state_pay',			'menu_name'=>'已付款',	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_pay'],
+                ['menu_key'=>'state_success',		'menu_name'=>Language::get('nc_member_path_finished'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_success'],
+                ['menu_key'=>'state_cancel',		'menu_name'=>Language::get('nc_member_path_canceled'),	'menu_url'=>'index.php?act=store_vr_order&op=index&state_type=state_cancel'],
+                ['menu_key'=>'exchange',		    'menu_name'=>'兑换码兑换',	'menu_url'=>'index.php?act=store_vr_order&op=exchange'],];
                 break;
         }
         Tpl::output('member_menu',$menu_array);

+ 48 - 0
shop/templates/default/seller/store_vr_order.receive.php

@@ -0,0 +1,48 @@
+<?php defined('InShopNC') or exit('Access Invalid!');?>
+<div class="eject_con">
+    <div id="warning"></div>
+    <form method="post"
+          id="order_success_form"
+          onsubmit="ajaxpost('order_success_form', '', '', 'onerror');return false;"
+          action="index.php?act=store_vr_order&op=change_state&state_type=order_success&order_id=<?php echo $output['order_id']; ?>">
+        <input type="hidden" name="form_submit" value="ok" />
+        <dl>
+            <dt><?php echo $lang['store_order_order_sn'].$lang['nc_colon'];?></dt>
+            <dd><span class="num"><?php echo trim($output['order_info']['order_sn']); ?></span></dd>
+        </dl>
+        <dl>
+            <dt>注意:</dt>
+            <dd><span>请确认您已经给下面卡号充完值了。</span></dd>
+        </dl>
+
+        <?php foreach ($output['order_info']['extend_order_info'] as $key => $value) { ?>
+        <dl class="line">
+            <dt><?php echo($key . ":"); ?></dt>
+            <dd><?php echo($value); ?></dd>
+        </dl>
+        <?php } ?>
+        <dl class="bottom">
+            <dt>&nbsp;</dt>
+            <dd>
+                <input type="submit" class="submit" id="confirm_button" value="<?php echo $lang['nc_ok'];?>" />
+            </dd>
+        </dl>
+    </form>
+</div>
+<script type="text/javascript">
+    $(function(){
+        $('#cancel_button').click(function(){
+            DialogManager.close('seller_order_receive_order');
+        });
+        $("input[name='state_info']").click(function(){
+            if ($(this).attr('flag') == 'other_reason')
+            {
+                $('#other_reason').show();
+            }
+            else
+            {
+                $('#other_reason').hide();
+            }
+        });
+    });
+</script>

+ 24 - 4
shop/templates/default/seller/store_vr_order.show.php

@@ -31,12 +31,32 @@
           <dt>买家留言:</dt>
           <dd><?php echo $output['order_info']['buyer_msg'];?></dd>
         </dl>
+          <?php
+            $order_sn = $output['order_info']['order_sn'];
+            $order_id = $output['order_info']['order_id'];
+            $uri = "index.php?act=store_vr_order&op=change_state&state_type=order_success&order_id={$order_id}&order_sn={$order_id}";
+            if(!empty($output['order_info']['extend_order_info'])) { ?>
+              <dl class="line">
+                  <dt>附加信息:</dt>
+              </dl>
+              <?php foreach ($output['order_info']['extend_order_info'] as $key => $value) { ?>
+            <dl class="line">
+                <dt><?php echo($key . ":"); ?></dt>
+                <dd><?php echo($value); ?></dd>
+            </dl>
+              <?php } ?>
           <dl class="line">
-              <dt>买家留言:</dt>
-              <dd><?php echo $output['order_info']['buyer_msg'];?></dd>
-              <dd><?php echo $output['order_info']['buyer_msg'];?></dd>
-              <dd><?php echo $output['order_info']['buyer_msg'];?></dd>
+              <dt></dt>
+              <dd>
+              <a href="javascript:void(0)" class="ncsc-btn-mini" nc_type="dialog" dialog_width="480"
+                 dialog_title="处理成功后确认订单"
+                 dialog_id="buyer_order_receive_order"
+                 uri=<?php echo($uri) ?>
+                 id="order_action_success">处理成功后确认订单</a>
+              </dd>
           </dl>
+
+          <?php } ?>
       </div>
     </div>
     <?php if ($output['order_info']['order_state'] == ORDER_STATE_CANCEL){ ?>

+ 43 - 30
test/TestMemberCard.php

@@ -18,6 +18,7 @@ require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 require_once(BASE_HELPER_PATH . '/util_helper.php');
 require_once(BASE_HELPER_PATH . '/order_helper.php');
 require_once(BASE_HELPER_PATH . '/bonus_helper.php');
+require_once(BASE_HELPER_PATH . '/vrorder_helper.php');
 
 use mcard;
 
@@ -36,7 +37,6 @@ class TestMemberCard extends TestCase
     }
 
 
-
     public function testAddMemberCard()
     {
         $usercards = new mcard\user_mcards($this->member_id);
@@ -72,32 +72,38 @@ class TestMemberCard extends TestCase
     public function testAddCardKey()
     {
         $items = [
-            ['card_no' => '1900000000418082', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 100],
-            ['card_no' => '1900000000418082', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 100],
-            ['card_no' => '1900000000418051', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
-            ['card_no' => '1900000000418052', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
-            ['card_no' => '1900000000418053', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
-            ['card_no' => '1900000000418054', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
-            ['card_no' => '1900000000418055', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
-            ['card_no' => '1900000000418056', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
-            ['card_no' => '1900000000418057', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
-            ['card_no' => '1900000000418058', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
-            ['card_no' => '1900000000418059', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
-            ['card_no' => '1900000000418060', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
-            ['card_no' => '1900000000418061', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
-            ['card_no' => '1900000000418062', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
-            ['card_no' => '1900000000418071', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
-            ['card_no' => '1900000000418072', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
-            ['card_no' => '1900000000418073', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
-            ['card_no' => '1900000000418074', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
-            ['card_no' => '1900000000418075', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
-            ['card_no' => '1900000000418076', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
-            ['card_no' => '1900000000418077', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
-            ['card_no' => '1900000000418078', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
-            ['card_no' => '1900000000418079', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
-            ['card_no' => '1900000000418080', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
-            ['card_no' => '1900000000418081', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
-            ['card_no' => '1900000000418082', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
+            ['card_no' => '1900000000418092', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 200],
+            ['card_no' => '1900000000418093', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 200],
+            ['card_no' => '1900000000418094', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 200],
+            ['card_no' => '1900000000418095', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 200],
+            ['card_no' => '1900000000418096', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 200],
+            ['card_no' => '1900000000418097', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 200],
+
+//            ['card_no' => '1900000000418082', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 100],
+//            ['card_no' => '1900000000418051', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
+//            ['card_no' => '1900000000418052', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
+//            ['card_no' => '1900000000418053', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
+//            ['card_no' => '1900000000418054', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
+//            ['card_no' => '1900000000418055', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
+//            ['card_no' => '1900000000418056', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
+//            ['card_no' => '1900000000418057', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
+//            ['card_no' => '1900000000418058', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
+//            ['card_no' => '1900000000418059', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
+//            ['card_no' => '1900000000418060', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
+//            ['card_no' => '1900000000418061', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
+//            ['card_no' => '1900000000418062', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
+//            ['card_no' => '1900000000418071', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
+//            ['card_no' => '1900000000418072', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
+//            ['card_no' => '1900000000418073', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
+//            ['card_no' => '1900000000418074', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
+//            ['card_no' => '1900000000418075', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
+//            ['card_no' => '1900000000418076', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
+//            ['card_no' => '1900000000418077', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
+//            ['card_no' => '1900000000418078', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
+//            ['card_no' => '1900000000418079', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
+//            ['card_no' => '1900000000418080', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PetroChinaCard, 'amount' => 1000],
+//            ['card_no' => '1900000000418081', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\SinopecCard, 'amount' => 500],
+//            ['card_no' => '1900000000418082', 'card_key' => 'm8i094k4t8n8', 'card_type' => mtopcard\PhoneCard, 'amount' => 100],
 
         ];
 
@@ -119,7 +125,7 @@ class TestMemberCard extends TestCase
     public function testOnVrOrderSuccess()
     {
         $logic = Logic('queue');
-        $logic->OnVrOrderSuccess(['order_sn' => '590648326923578620']);
+        $logic->OnVrOrderSuccess(['order_sn' => '920648515867397620']);
     }
 
     public function testVOrderPaidSuccess()
@@ -132,8 +138,8 @@ class TestMemberCard extends TestCase
     //测试购买会员,成功支付,改变用户会员属性,修改状态.
     public function testPaidVOrderSuccess()
     {
-        $order_sn = '760648246884596620';
-        $trade_no = '730510765598547567';
+        $order_sn = '920648515867397620';
+        $trade_no = '730510765598547590';
 
         $payer = new pay_helper($order_sn);
         $payer->update_order($trade_no,'wxpay');
@@ -145,6 +151,13 @@ class TestMemberCard extends TestCase
         $logic->OnMCardPaidSuccess(['order_sn' => '580648112029501620']);
     }
 
+    public function testExtraInfo()
+    {
+        $order_sn = '920648515867397620';
+        $model_order = Model('vr_order');
+        $order = $model_order->getOrderInfo(['order_sn' => $order_sn]);
+        vrorder_helper::extend_order_info($order);
+    }
 
     public function testStrict()
     {