Commit 859f928d by 孙龙

bug修改

parent 4396caee
...@@ -138,10 +138,9 @@ class OrderService extends BaseService ...@@ -138,10 +138,9 @@ class OrderService extends BaseService
if(!empty($returnItems)){ if(!empty($returnItems)){
foreach($insertReturnItemData as $field=>$val){ foreach($insertReturnItemData as $field=>$val){
if($field == "type" && !in_array($val["type"],[1,2])){ if($field != "type" || !in_array($val,[1,2])){
continue; continue;
} }
if($field == "return_goods_number" && !$val){ if($field == "return_goods_number" && !$val){
continue; continue;
} }
...@@ -166,6 +165,7 @@ class OrderService extends BaseService ...@@ -166,6 +165,7 @@ class OrderService extends BaseService
if($createOrEdit){ if($createOrEdit){
$insertReturnItemData["return_amount"] = decimal_number_format($insertReturnItemData["return_price"] * $insertReturnItemData["return_num"]); $insertReturnItemData["return_amount"] = decimal_number_format($insertReturnItemData["return_price"] * $insertReturnItemData["return_num"]);
} }
$createOrEdit && OrderReturnItems::create(array_merge($insertReturnItemData,["create_time"=>time()])); $createOrEdit && OrderReturnItems::create(array_merge($insertReturnItemData,["create_time"=>time()]));
} }
...@@ -287,6 +287,8 @@ class OrderService extends BaseService ...@@ -287,6 +287,8 @@ class OrderService extends BaseService
if(empty($orderInfo)){ if(empty($orderInfo)){
throw new InvalidRequestException(admin_trans("order.return_msg.50005")); throw new InvalidRequestException(admin_trans("order.return_msg.50005"));
} }
$freightCharge = $freightCharge <= 0 ? 0 : $freightCharge;
$payCommission = $payCommission <= 0 ? 0 : $payCommission;
OrderPrice::editOrderSettlement($orderId,$orderInfo["order_sn"],$freightCharge,$payCommission); OrderPrice::editOrderSettlement($orderId,$orderInfo["order_sn"],$freightCharge,$payCommission);
Order::updateOrder(["order_id"=>$orderId],[ Order::updateOrder(["order_id"=>$orderId],[
"order_user_pay_type"=>$orderUserPayType, "order_user_pay_type"=>$orderUserPayType,
......
...@@ -37,8 +37,6 @@ class OrderPrice extends Model ...@@ -37,8 +37,6 @@ class OrderPrice extends Model
//新增或者修改订单的 运费 支付手续费 //新增或者修改订单的 运费 支付手续费
public static function editOrderSettlement($orderId,$orderSn,$freightCharge,$payCommission){ public static function editOrderSettlement($orderId,$orderSn,$freightCharge,$payCommission){
if($freightCharge){
self::updateOrCreate([ self::updateOrCreate([
"order_id"=>$orderId, "order_id"=>$orderId,
"price_type"=>self::$PRICE_TYPE_LIST["运费"], "price_type"=>self::$PRICE_TYPE_LIST["运费"],
...@@ -48,9 +46,8 @@ class OrderPrice extends Model ...@@ -48,9 +46,8 @@ class OrderPrice extends Model
"currency"=>2, "currency"=>2,
"create_time"=>time(), "create_time"=>time(),
]); ]);
}
if($payCommission){
self::updateOrCreate([ self::updateOrCreate([
"order_id"=>$orderId, "order_id"=>$orderId,
"price_type"=>self::$PRICE_TYPE_LIST["支付手续费"], "price_type"=>self::$PRICE_TYPE_LIST["支付手续费"],
...@@ -60,7 +57,7 @@ class OrderPrice extends Model ...@@ -60,7 +57,7 @@ class OrderPrice extends Model
"currency"=>2, "currency"=>2,
"create_time"=>time(), "create_time"=>time(),
]); ]);
}
} }
......
...@@ -413,10 +413,10 @@ ...@@ -413,10 +413,10 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">{{admin_trans("order.order_page.支付方式")}}:</label> <label class="layui-form-label">{{admin_trans("order.order_page.支付方式")}}:</label>
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-form-mid">{{$info["settlementInfo"]["order_user_pay_type_cn"]}}</div> <div class="layui-form-mid">{{$info["settlementInfo"]["order_user_pay_type_cn"]}} </div>
<div class="show" style="display: none"> <div class="show" style="display: none">
<input type="radio" name="order_user_pay_type" value="1" title="Paypal" checked> <input type="radio" name="order_user_pay_type" value="1" title="Paypal" @if($info["settlementInfo"]["order_user_pay_type"] == "1") checked @endif >
<input type="radio" name="order_user_pay_type" value="2" title="TT"> <input type="radio" name="order_user_pay_type" value="2" @if($info["settlementInfo"]["order_user_pay_type"] == "2") checked @endif title="TT">
</div> </div>
</div> </div>
</div> </div>
......
<table border="1"> <table border="1">
<tr> <tr>
<td rowspan="4"> <td rowspan="4">
<img src="./assets/images/logo.png" width="50" height="50" >
</td> </td>
</tr> </tr>
......
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