调试信用购订单结算

This commit is contained in:
luofei 2023-07-10 09:50:22 +08:00
parent 89b5939738
commit 0cb434eceb
3 changed files with 15 additions and 7 deletions

View File

@ -66,6 +66,7 @@ class ExceptionHandle extends Handle
{
// 添加自定义异常处理机制
$this->report($e);
DingTalk::exception($e, $e->getMessage(), $request);
// 其他错误交给系统处理
if ($e instanceof ValidateException)
return app('json')->fail($e->getMessage());
@ -82,7 +83,6 @@ class ExceptionHandle extends Handle
else if ($e instanceof \EasyWeChat\Core\Exceptions\HttpException)
return app('json')->fail($e->getMessage());
DingTalk::exception($e, $request);
return parent::render($request, $e);
}
}

View File

@ -68,13 +68,18 @@ class StoreGroupOrderRepository extends BaseRepository
$query->field('mer_id,mer_name,settle_cycle,interest_rate');
}, 'orderProduct','presellOrder']);
}, 'interest'])->page($page, $limit)->order('create_time DESC')->select();
$return = [];
foreach ($list as $k => $item) {
$current = $item->toArray();
if (!empty($item->interest)) {
$interest = $item->interest->calculateInterest();
$list[$k]['interest']['total_amount'] = bcadd($item->interest->total_price, $interest, 2);
$current['interest']['total_amount'] = bcadd($item->interest->total_price, $interest, 2);
} else {
$current['interest']['total_amount'] = $item['total_price'];
}
$return[] = $current;
}
return compact('count', 'list');
return compact('count', 'return');
}
/**
@ -100,12 +105,15 @@ class StoreGroupOrderRepository extends BaseRepository
$flag && $query->field('mer_id,mer_name,settle_cycle,interest_rate');
}, 'orderProduct', 'presellOrder']);
}, 'interest'])
->order('create_time DESC')->find();
->order('create_time DESC')->append(['cancel_time', 'cancel_unix'])->find();
$return = $order->toArray();
if (!empty($order->interest)) {
$interest = $order->interest->calculateInterest();
$order['interest']['total_amount'] = bcadd($order->interest->total_price, $interest, 2);
$return['interest']['total_amount'] = bcadd($order->interest->total_price, $interest, 2);
} else {
$return['interest']['total_amount'] = $order['total_price'];
}
return $order;
return $return;
}
public function status($uid, $id)

View File

@ -196,7 +196,7 @@ class StoreOrder extends BaseController
if (!$groupOrder)
return app('json')->fail('订单不存在');
else
return app('json')->success($groupOrder->append(['cancel_time', 'cancel_unix'])->toArray());
return app('json')->success($groupOrder);
}
public function groupOrderStatus($id, StoreGroupOrderRepository $groupOrderRepository)