Commit 1d322210 authored by hangjun83's avatar hangjun83

罗恩工具类更新

parent 5bc466fb
......@@ -535,7 +535,6 @@ class RhawnOrdersService
->where('pstk_id', $pstk_id)
->get()->first();
//$dpdDetail = $dpdDetail->toArray();
if ($dpdDetail) {
// 更新当前记录
$dpUpdateArr = [];
......@@ -546,13 +545,30 @@ class RhawnOrdersService
if($refundInfo->handle_fee > 0){
$dpUpdateArr['dpd_num'] = $dpdDetail->dpd_num;
$dpUpdateArr['dpd_amount'] = bcmul($updatedItem['update']['si_discount'], $currentProcessNums, 2);
} // 如果没有手续费,只修改对应的si_id
else{
$dpUpdateArr['si_id'] = $updatedItem['create']['si_id'];
$dpUpdateArr['dpd_amount'] = $dpdDetail->dpd_amount;
}
} // 如果不是全部退货
else{
if($refundInfo->handle_fee > 0){
$otherDpdDetail = $dbConnect->table('dpdetail')
->where('si_id', $orderitem['si_id'])
->whereNotIn('pstk_id', $pstk_id)
->get()->first();
$otherUpdate = [];
$otherUpdate['dpd_amount'] = bcmul($updatedItem['update']['si_discount'], $otherDpdDetail->dpd_num, 2);
$dbConnect->table('dpdetail')
->where('dpd_id', $otherDpdDetail->dpd_id)
->update($otherUpdate);
}
}
$dbConnect->table('dpdetail')
->where('dpd_id', $dpdDetail->dpd_id)
->update($dpUpdateArr);
// 如果是部分退货
if ($currentProcessNums <= $dpdDetail->dpd_num) {
if (($currentProcessNums < $dpdDetail->dpd_num ) || ($currentProcessNums == $dpdDetail->dpd_num && $refundInfo->handle_fee > 0)) {
//添加新的取消记录
$dpCreateArr = $dpdDetail;
unset($dpCreateArr->dpd_id);
......
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