Commit b6165e6f authored by hangjun83's avatar hangjun83

修复bug

parent 506d5a0d
...@@ -107,13 +107,17 @@ class BhOrdersService ...@@ -107,13 +107,17 @@ class BhOrdersService
//查询订单的详情 //查询订单的详情
$soItems = app(BhSoitemsRepository::class)->getSorderItemsDetailFromOrderId($sOrder->so_id); $soItems = app(BhSoitemsRepository::class)->getSorderItemsDetailFromOrderId($sOrder->so_id);
$soItems = $soItems->toArray(); $soItems = $soItems->toArray();
$returnItem = [];
if($soItems){ if($soItems){
foreach($soItems as &$item){ foreach($soItems as $item){
$item['so_no'] = $sOrder->so_no; $item['so_no'] = $sOrder->so_no;
if($item['si_if_cancel'] == 0){
$returnItem[] = $item;
}
} }
} }
return $soItems; return $returnItem;
} }
public function addSordersRefundTask($request) public function addSordersRefundTask($request)
...@@ -337,6 +341,7 @@ class BhOrdersService ...@@ -337,6 +341,7 @@ class BhOrdersService
} }
$cancelRecord = []; $cancelRecord = [];
// 如果退货数量跟此明细数量相同
if(!is_null($needUpdate)){ if(!is_null($needUpdate)){
$dpUpdateArr = []; $dpUpdateArr = [];
$dpUpdateArr['si_id'] = $newItem->toArray()['si_id']; $dpUpdateArr['si_id'] = $newItem->toArray()['si_id'];
...@@ -355,12 +360,12 @@ class BhOrdersService ...@@ -355,12 +360,12 @@ class BhOrdersService
//将取消的记录价格进行更新 //将取消的记录价格进行更新
$dpUpdateArr['dpd_amount'] = bcmul($createArr['si_discount'], $needUpdate['dpd_num'], 2); $dpUpdateArr['dpd_amount'] = bcmul($createArr['si_discount'], $needUpdate['dpd_num'], 2);
$dbConnect->table('dpdetail') $dbConnect->table('dpdetail')
->where('dpd_id',$dpdetail->dpd_id) ->where('dpd_id',$needUpdate['dpd_id'])
->update($dpUpdateArr); ->update($dpUpdateArr);
} // 如果没有手续费,不对价格进行更新 } // 如果没有手续费,不对价格进行更新
else{ else{
$dbConnect->table('dpdetail') $dbConnect->table('dpdetail')
->where('dpd_id',$dpdetail->dpd_id) ->where('dpd_id',$needUpdate['dpd_id'])
->update($dpUpdateArr); ->update($dpUpdateArr);
} }
}else{ }else{
......
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 to comment