Client.php 2.07 KB
<?php
/**
 * 购物相关
 *
 */
class YHMOrders_Models_Shopping_Client
{

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

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

    public static function create(array $orderData)
    {
        return self::dao()->create($orderData);
    }

    /**
     * 修改价格
     * 
     * @param array $package
     * @return int
     */
    public static function addShoppingChangePrice(array $package)
    {
        return self::dao()->addShoppingChangePrice($package);
    }

    /**
     * 修改订单价格
     * 
     * @param array $package
     * @return int
     */
    public static function addShoppingOrderChangePrice(array $package)
    {
    	return self::dao()->addShoppingOrderChangePrice($package);
    }
    
    /**
     * 获取购物改价
     * @param $agreementKey
     * @param $buyerUid
     * @return Array
     */
    public static function getShoppingChangePrice($agreementKey, $buyerUid)
    {
        return self::dao()->getShoppingChangePrice($agreementKey, $buyerUid);
    }

    /**
     * @param $agreementKey
     * @param $orderCode
     * @param $isBuyer
     * @return int
     */
    public static function updateShoppingChange($agreementKey, $orderCode, $isBuyer = 'Y')
    {
        return self::dao()->updateShoppingChange($agreementKey, $orderCode, $isBuyer);
    }

    /**
     * 获取指定小于状态的购买数量
     * @param $productSku
     * @param $orderStatus
     * @return Array
     */
    public static function getBuyGoodsNumber($productSku, $orderStatus = 900)
    {
        return self::dao()->getBuyGoodsNumber((int)$productSku, (int)$orderStatus);
    }
    
    /**
     * 插入订单镜像表
     * @param $storeID
     * @return mixed
     */
    public static function setBuyGoodsInfo($data)
    {
    	return self::dao()->setBuyGoodsInfo($data);
    }
   
}