Commit 6eb0329a by 孙龙

订单详情

parent b85d3ca1
Showing with 8 additions and 6 deletions
...@@ -117,8 +117,8 @@ class OrderService extends BaseService ...@@ -117,8 +117,8 @@ class OrderService extends BaseService
// dd($returnItems); // dd($returnItems);
foreach ($orderItems as $orderItem){ foreach ($orderItems as $orderItem){
OrderItem::updateOrderItem(["rec_id"=>$orderItem["order_items_id"]],[ OrderItem::updateOrderItem(["rec_id"=>$orderItem["order_items_id"]],[
"goods_price"=>$orderItem["goods_price"], "goods_price"=>floatval($orderItem["goods_price"]) <= 0 ? 0 : $orderItem["goods_price"],
"goods_number"=>$orderItem["goods_number"], "goods_number"=>intval($orderItem["goods_number"]) <= 0 ? 0 : $orderItem["goods_number"],
]); ]);
$returnItems = OrderReturnItems::getOrderReturnItem($orderItem["order_items_id"]); $returnItems = OrderReturnItems::getOrderReturnItem($orderItem["order_items_id"]);
...@@ -126,8 +126,8 @@ class OrderService extends BaseService ...@@ -126,8 +126,8 @@ class OrderService extends BaseService
"type"=>$orderItem["return_type"], "type"=>$orderItem["return_type"],
"order_id"=>$order_id, "order_id"=>$order_id,
"rec_id"=>$orderItem["order_items_id"], "rec_id"=>$orderItem["order_items_id"],
"return_num"=>$orderItem["return_goods_number"], "return_num"=>intval($orderItem["return_goods_number"]) <= 0 ? 0 : intval($orderItem["return_goods_number"]),
"return_price"=>$orderItem["return_goods_price"], "return_price"=>floatval($orderItem["return_goods_price"]) <= 0 ? 0 : $orderItem["return_goods_price"],
"return_amount"=> $orderItem["return_amount"], "return_amount"=> $orderItem["return_amount"],
// "return_amount"=> decimal_number_format($orderItem["return_goods_number"] * $orderItem["return_goods_price"]), // "return_amount"=> decimal_number_format($orderItem["return_goods_number"] * $orderItem["return_goods_price"]),
]; ];
...@@ -136,9 +136,8 @@ class OrderService extends BaseService ...@@ -136,9 +136,8 @@ class OrderService extends BaseService
$createOrEdit = false; $createOrEdit = false;
if(!empty($returnItems)){ if(!empty($returnItems)){
foreach($insertReturnItemData as $field=>$val){ foreach($insertReturnItemData as $field=>$val){
if($field != "type" || !in_array($val,[1,2])){ if($field == "type" && !in_array($val,[1,2])){
continue; continue;
} }
if($field == "return_goods_number" && !$val){ if($field == "return_goods_number" && !$val){
...@@ -155,6 +154,9 @@ class OrderService extends BaseService ...@@ -155,6 +154,9 @@ class OrderService extends BaseService
} }
} }
}else{ }else{
if(in_array($insertReturnItemData["type"],[1,2]) && $insertReturnItemData["return_price"] && $insertReturnItemData["return_num"]){ if(in_array($insertReturnItemData["type"],[1,2]) && $insertReturnItemData["return_price"] && $insertReturnItemData["return_num"]){
$createOrEdit = true; $createOrEdit = true;
......
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