|
@@ -146,26 +146,30 @@ class Refund
|
|
|
if ($order_goods_id) {
|
|
|
$info = Dever::db($this->goods_table)->find(array('id' => $order_goods_id, 'order_id' => $data['id'], 'status' => 1));
|
|
|
if ($info) {
|
|
|
+
|
|
|
+ Dever::db($this->goods_table)->update(array('where_id' => $info['id'], 'status' => 2));
|
|
|
+
|
|
|
if (!$num) {
|
|
|
$num = $info['num'];
|
|
|
}
|
|
|
- Dever::db($this->goods_table)->update(array('where_id' => $info['id'], 'status' => 2));
|
|
|
- if (isset($info['coupon_cash']) && $info['coupon_cash']) {
|
|
|
- $cash = $info['total_price'] - $info['coupon_cash'];
|
|
|
- } else {
|
|
|
- $cash = $info['total_price'];
|
|
|
- }
|
|
|
-
|
|
|
- $kou = $data['card_code_cash'] + $data['wallet_cash'];
|
|
|
$info['total_price'] = $info['price'] * $num;
|
|
|
+ $kou = $data['card_code_cash'] + $data['wallet_cash'];
|
|
|
+
|
|
|
if ($kou > 0) {
|
|
|
if ($info['total_price'] >= $kou) {
|
|
|
- $cash = $info['total_price'] - $kou;
|
|
|
+ $info['total_price'] = $info['total_price'] - $kou;
|
|
|
} else {
|
|
|
- $cash = 0;
|
|
|
+ $info['total_price'] = 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (isset($info['coupon_cash']) && $info['coupon_cash']) {
|
|
|
+ $cash = $info['total_price'] - $info['coupon_cash'];
|
|
|
+ } else {
|
|
|
+ $cash = $info['total_price'];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if (isset($info['p_price'])) {
|
|
|
$p_cash = $info['p_price'] * $num;
|
|
|
} else {
|