Commit 859f928d by 孙龙

bug修改

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