Commit 17c857d1 by 孙龙

订单修改

parent 64aaa7e3
Showing with 9 additions and 1 deletions
......@@ -103,6 +103,9 @@ class OrderService extends BaseService
//修改订单明细数量价格
public static function editOrderItems($order_id,$orderItems,$order_remark){
if(!is_array($orderItems)){
$orderItems = json_decode($orderItems,true);
}
(new self)->startTransaction();
try{
// $orderItemids = Arr::pluck($orderItems,"order_items_id");
......@@ -125,8 +128,10 @@ class OrderService extends BaseService
"rec_id"=>$orderItem["order_items_id"],
"return_num"=>$orderItem["return_goods_number"],
"return_price"=>$orderItem["return_goods_price"],
"return_amount"=> decimal_number_format($orderItem["return_goods_number"] * $orderItem["return_goods_price"]),
"return_amount"=> $orderItem["return_amount"],
// "return_amount"=> decimal_number_format($orderItem["return_goods_number"] * $orderItem["return_goods_price"]),
];
$createOrEdit = false;
if(!empty($returnItems)){
......@@ -150,6 +155,9 @@ class OrderService extends BaseService
}
}
if($createOrEdit){
$insertReturnItemData["return_amount"] = decimal_number_format($orderItem["return_goods_number"] * $orderItem["return_goods_price"]);
}
$createOrEdit && OrderReturnItems::create(array_merge($insertReturnItemData,["create_time"=>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