|
@@ -578,7 +578,16 @@ class Buy
|
|
|
$state = Dever::db('shop/buy_order')->update(array('where_id' => $data['id'], 'status' => 7, 'operdate' => time()));
|
|
|
# 生成结算单
|
|
|
if ($state) {
|
|
|
- //Dever::load('cash/lib/order')->up($data, 1, 3);
|
|
|
+
|
|
|
+ if (isset($data['recard_cash']) && $data['recard_cash'] && $data['recard_cash'] > 0) {
|
|
|
+ # 还原钱包
|
|
|
+ $shop = Dever::db('shop/info')->find($data['type_id']);
|
|
|
+ if ($shop) {
|
|
|
+ Dever::load('shop/lib/record')->pingtai($shop['id'], $shop['sid'],3, $data['id'], $data['recard_cash'], round($shop['price'] + $data['recard_cash'], 2), '订单退货返还');
|
|
|
+
|
|
|
+ Dever::load('cash/lib/order')->up($data, 1, 3);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return 'ok';
|
|
|
} else {
|