Orderstatus.php 4.02 KB
<?php

/**
 * Description of Orderstatus
 *
 * @author elkan
 */
class YHMConfig_Orderstatus {

    /**
     * 订单建立阶段100(下单成功即在线支付未付款100)
     */
    const WAIT_BUYER_PAY = 100;

    /**
     * 发货阶段300(待发货:300);
     */
    const WAIT_SELLER_SEND_GOODS = 300;

    /**
     * 提醒卖家发货
     * @var unknown
     */
    const NOTICE_SELLER_SEND_GOODS = 310;

    /**
     * 发货阶段300(已发货等待确认收货350,);
     */
    const WAIT_BUYER_CONFIRM_GOODS = 350;

    /**
     * 订单完成600(订单完成600);
     */
    const TRADE_FINISHED = 600;

    /**
     * 买家评价
     * @var int
     */
    const BUYER_COMMENT = 610;
    
    /**
     * 打款成功
     * @var int
     */
    const REMIT_SUCCESS = 620; //新增状态
    
    /**
     *  取消订单(买家取消900)
     */
    const BUYER_CANCEL_ORDER = 900;

    /**
     *  取消订单(卖家取消910)
     */
    const SELLER_CANCEL_ORDER = 910;

    /**
     * 买家申请退款
     * @var
     */
    const REFUND_BUYER_REQ = 800;

    /**
     * 卖家拒绝退款
     * @var
     */
    const REFUND_SELLER_REJECT = 801;

    /**
     * 卖家确认退款
     * @var
     */
    const REFUND_SELLER_CONFIRM = 802;
    
    /**
     * 买家取消申请退款
     */
    const REFUND_BUYER_CANCEL = 803;
    
    /**
     * 退款成功
     * @var
     */
    const REFUND_SUCCESS = 810; //新增状态

    public static $order_status = array(
        "WAIT_BUYER_PAY" => 100,
        "WAIT_SELLER_SEND_GOODS" => 300,
        'NOTICE_SELLER_SEND_GOODS' => 310,
        "WAIT_BUYER_CONFIRM_GOODS" => 350,
        "TRADE_FINISHED" => 600,
        'BUYER_COMMENT' => 610,
        'REMIT_SUCCESS' => 620, //新增状态
        'REFUND_BUYER_REQ' => 800,
        'REFUND_SELLER_REJECT' => 801,
        'REFUND_SELLER_CONFIRM' => 802,
        'REFUND_BUYER_CANCEL' => 803,
        'REFUND_SUCCESS' => 810, //新增状态
        'BUYER_CANCEL_ORDER' => 900,
        'SELLER_CANCEL_ORDER' => 910
    );

    /**
     * 订单状态字对应的订单状态码,为了api接口传出的参数更容易懂
     * @var array
     */
    public static $status_code = array(
        100 => "WAIT_BUYER_PAY", //等待买家付款,相当于买家下单成功
        300 => "WAIT_SELLER_SEND_GOODS", //买家付款完成,等待卖家发货
        310 => 'NOTICE_SELLER_SEND_GOODS', //提醒卖家发货
        350 => "WAIT_BUYER_CONFIRM_GOODS", //卖家已经发货,等待卖家付款
        600 => "TRADE_FINISHED", //交易完成
        610 => 'BUYER_COMMENT', //买家评价
        620 => 'REMIT_SUCCESS',//打款成功 //新增状态
        800 => 'REFUND_BUYER_REQ',
        801 => 'REFUND_SELLER_REJECT',
        802 => 'REFUND_SELLER_CONFIRM',
        803 => 'REFUND_BUYER_CANCEL',
        810 => 'REFUND_SUCCESS', //新增状态 
        900 => 'BUYER_CANCEL_ORDER',
        910 => 'SELLER_CANCEL_ORDER',
    );

    /**
     * 状态的明细
     * @var array
     */
    public static $status_caption = array(
        "100" => '买家下单',
        "300" => '买家付款',
        '310' => '提醒卖家发货',
        "350" => '卖家发货',
        "600" => '买家确认收货',
        '610' => '买家评价',
        '620' => '打款成功', //新增状态
        '800' => '买家申请退款',
        '801' => '卖家拒绝退款',
        '802' => '卖家同意退款',
        '803' => '买家取消退款',
        '810' => '退款成功',  //新增状态
        '900' => '买家取消订单',
        '910' => '卖家取消订单'
    );

    /**
     * 订单主状态
     * @var array
     */
    public static $main_status = array(310);

    /**
     * 购买者的状态
     * @var array
     */
    public static $buyer_status = array(100, 300, 310, 600, 610, 800, 803, 810, 900);

    //正常商品   main_goods
    const ORDER_GOODS_TYPE_MAIN = 1;
    //赠品 gift_goods
    const ORDER_GOODS_TYPE_GIFT = 2;
    //免单商品   advance_goods
    const ORDER_GOODS_TYPE_ABVANCE = 3;

}