Commit f67174ed authored by hangjun83's avatar hangjun83

乐妍

parent df506d22
......@@ -158,36 +158,21 @@ class BhuaOrdersService
* @param $cus_level
* @return float|int
*/
public function getExpress($weight,$province,$total,$if_free_express,$cus_level){
public function getExpress($weight,$province,$total){
//计算运费 (运费=首重(1kg)*运输系数(首重)+续重(总重量-1kg)*运输系数(续重))
$express = 0;
if($if_free_express == 1 || $cus_level == 3){
return $express;
}else{
if($cus_level == 0){
$max_amount = 150;
}
if($cus_level == 1){
$max_amount = 99;
}
if($cus_level == 2){
$max_amount = 66;
}
//统一调整为满66免运费
//$max_amount = 66;
if($weight == 0){
$weight = 0.1;
}
if($total < $max_amount && $weight > 0){
$weight = ceil($weight);
if($province == '江苏省' || $province == '浙江省' || $province == '上海' || $province == '上海市'){
$express = ($weight - 1)*2 + 6;
}else{
$express = ($weight - 1)*8 + 10;
}
if($weight == 0){
$weight = 0.1;
}
if($total < 99 && $weight > 0){
$weight = ceil($weight);
if($province == '江苏省' || $province == '浙江省' || $province == '上海'){
$express = ($weight - 1)*2 + 6;
}else{
$express = ($weight - 1)*8 + 10;
}
return $express;
}
return $express;
}
public function getCustomerOrderItemsByOrderId($cusId, $orderId)
......
......@@ -44,7 +44,7 @@ class BhuaOrdersService
}
$express = $this->bhuaOrdersService->getExpress(
$orderItems['weight'],$requestParams['so_ca_province'],$orderItems['total'],0,0
$orderItems['weight'],$requestParams['so_ca_province'],$orderItems['total']
);
$order = $this->bhuaOrdersService->bhuaSorderRepository->getSorderFromOrderCusPo($requestParams['so_cus_po']);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment