Client.php 1.91 KB
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: elkan
 * Date: 14-8-5
 * Time: 下午6:04
 * To change this template use File | Settings | File Templates.
 */
class YHMOrders_Models_Status_Client {

    /**
     *
     * @var YHMOrders_Models_Status_Dao
     */
    private static $dao;

    /**
     *
     * @return YHMOrders_Models_Status_Dao
     */
    static private function dao() {
        if (empty(self::$dao)) {
            self::$dao = new YHMOrders_Models_Status_Dao();
        }
        return self::$dao;
    }

    /**
     * 获取订单历史状态
     * @param int $order_code
     * @return int
     */
    static function getByOrderCode($order_code) {
        if ((int) $order_code < 1) {
            return 0;
        }
        return self::dao()->getByOrderCode((int) $order_code);
    }
    /**
     * 查看是否已有相同的状态
     * @param type $order_code
     */
    static function getRepeatStatusByOrderCode($order_code,$status){
        if ((int) $order_code < 1) {
            return 0;
        }
        return self::dao()->getRepeatStatusByOrderCode((int) $order_code,$status);
    }
    /**
     * 添加状态
     * @param integer $order_code
     * @param integer $order_status
     * @param integer $trigger_user
     */
    public static function setOrderstatus($order_code, $order_status, $trigger_user) {
    	return self::dao()->setOrderstatus($order_code, $order_status, $trigger_user);
    }
      /**
     * 获取订单状态
     * @param integer $order_code
     * @param integer $order_status
     * @param integer $trigger_user
     */
    public static function getOrderStatus($order_code) {
    	return self::dao()->getOrderStatus($order_code);
    }
    /*
     *获取某阶段内订单状态列表 
     */
    public static function getOrderStatusByTime($time,$order_status,$type=1){
        return self::dao()->getOrderStatusByTime($time,$order_status,$type);
    } 
       

}