<?php
defined('IN_IA') || exit('Access Denied');
/**
 * 驿站快递计费
 * @param 快递名称 $expressshop
 * @param 数量 $num
 * @return 费用 $price
 */
function dak_charging($expressshop,$num){
    global  $_W;
    $allprice =0;
    $dak = pdo_get("evzg_express_setting",array('uniacid'=>$_W['uniacid']));
    if($dak['daktype']==0){
        return $allprice;
    }
    if($dak['daktype']==1){
        $allprice = intval($num)*floatval($dak['dakprice']);
        return $allprice;
    }
    if($dak['daktype']==2){
        $printcompany = pdo_get("evzg_express_printcompany",array('expressname'=>$expressshop,'status'=>1));
        $allprice = intval($num)*floatval($printcompany['dakprice']);
        return $allprice;
    }
}
/**
 * 获取驿站设置计费类
 * @return Ambigous <>
 */
function dak_get_type(){
    global  $_W;
    $dak = pdo_fetch("evzg_express_setting",array('uniacid'=>$_W['uniacid']));
    return $dak['daktype'];
}
?>