深茂订单详情

parent 9644b8da
......@@ -379,7 +379,7 @@ class OrderService
"goods_id"=>$v["goods_id"],
"goods_name"=>$v["goods_name"],
"brand_name"=>$v["brand_name"],
"delivery_time"=>$v["delivery_time"],
"delivery_time"=>changeDeliverToEn($v["delivery_time"]),
"pdf"=>\Arr::get($oneInfo,"pdf"),
"goods_number"=>$v["goods_number"],
"goods_price"=>$v["goods_price"],
......
......@@ -116,3 +116,30 @@ function getRate($k = "美元")
function timeToDate($timestr){
return $timestr >0 ? date("Y-m-d H:i:s",$timestr) : "";
}
/*
* 工作日或者周转换英文
*/
function changeDeliverToEn($delivery_time){
$day_filter = ["工作日","个工作日","日"];
$week_filter = ["周"];
//货区去掉工作日
$hk_delivery_time_origin = $delivery_time;
$delivery_time = str_replace("工作日","",$delivery_time);
$delivery_time = str_replace("个","",$delivery_time);
#工作日转换
foreach ($day_filter as $d){
if (strpos($hk_delivery_time_origin,$d) !== false){
$delivery_time = $delivery_time." workdays";
break;
}
}
#周转换
foreach ($week_filter as $d){
if (strpos($hk_delivery_time_origin,$d) !== false){
$delivery_time = $delivery_time." weeks";
break;
}
}
return $delivery_time;
}
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 sign in to comment