退款新加类型
This commit is contained in:
parent
e0f8caf64a
commit
7742312d73
@ -496,6 +496,7 @@ class OrderController extends BaseApiController
|
||||
ApiDoc\Param(name: "refund_num", type: "int", require: true, desc: "退款数量"),
|
||||
ApiDoc\Param(name: "id", type: "int", require: true, desc: "订单id"),
|
||||
ApiDoc\Param(name: "old_cart_id", type: "int", require: true, desc: "购物车id"),
|
||||
ApiDoc\Param(name: "refund_type", type: "int", require: true, desc: "退款申请类型"),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Header(name: "token", type: "string", require: true, desc: "token"),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
|
@ -636,6 +636,7 @@ class OrderLogic extends BaseLogic
|
||||
$price =bcsub($price, $onePrice);
|
||||
}
|
||||
$order->refund_price = $price;
|
||||
$order->refund_type = $params['refund_type'];
|
||||
$order->save();
|
||||
}else{
|
||||
// 多单的情况 拆主订单为新的2单 修改新的2单的核销码 修改cart_info的核销码 和订单id 退款直接退一单的钱
|
||||
@ -648,7 +649,7 @@ class OrderLogic extends BaseLogic
|
||||
->whereNotIn('old_cart_id',$params['old_cart_id'])
|
||||
->select()->toArray();
|
||||
if($cart_info){
|
||||
$leftOrder = self::dealCreateLeftOrder($order,$cart_info);
|
||||
$leftOrder = self::dealCreateLeftOrder($order,$cart_info,$params);
|
||||
self::dealChangeCartInfo($leftOrder);
|
||||
}
|
||||
$refundOrder = self::dealCreateRefundOrder($order,$params);
|
||||
@ -683,7 +684,7 @@ class OrderLogic extends BaseLogic
|
||||
|
||||
|
||||
|
||||
public static function dealCreateLeftOrder($order,$cart_info)
|
||||
public static function dealCreateLeftOrder($order,$cart_info,$params)
|
||||
{
|
||||
//查出不在这个退货中的数据
|
||||
$order['order_id'] = $order['order_id'].'-2';
|
||||
@ -711,6 +712,7 @@ class OrderLogic extends BaseLogic
|
||||
}
|
||||
$order['cart_id'] = implode(',',$allOldCartIds);
|
||||
$order['total_num'] = count($cart_info);
|
||||
$order['refund_type'] = $params['refund_type'];
|
||||
$order['total_price'] = number_format($totalTotal, 2);
|
||||
$order['pay_price'] = number_format($totalPrice, 2);
|
||||
$order['vip_price'] = number_format($totalVipPrice, 2);
|
||||
|
@ -22,6 +22,7 @@ class OrderValidate extends BaseValidate
|
||||
'refund_num' => 'require|number',
|
||||
'id' => 'require|number',
|
||||
'old_cart_id' => 'require|array',
|
||||
'refund_type' => 'require|number',
|
||||
];
|
||||
|
||||
|
||||
@ -35,6 +36,7 @@ class OrderValidate extends BaseValidate
|
||||
'refund_num' => '退款数量',
|
||||
'id' => '订单id',
|
||||
'old_cart_id' => '购物车id',
|
||||
'refund_type' => '退款申请类型',
|
||||
];
|
||||
|
||||
|
||||
@ -55,7 +57,7 @@ class OrderValidate extends BaseValidate
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->only(['refund_message','refund_num','id','old_cart_id']);
|
||||
return $this->only(['refund_message','refund_num','id','old_cart_id','refund_type']);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user