Merge branch 'feature/purchase_record' into dev

This commit is contained in:
luofei 2023-07-10 09:33:30 +08:00
commit 58d61742f0
2 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@
namespace app;
use crmeb\utils\DingTalk;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\db\exception\PDOException;
@ -81,6 +82,7 @@ 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

@ -101,7 +101,10 @@ class StoreGroupOrderRepository extends BaseRepository
}, 'orderProduct', 'presellOrder']);
}, 'interest'])
->order('create_time DESC')->find();
$interest = $order->interest->calculateInterest();
$interest = '0';
if (is_callable([$order->interest, 'calculateInterest'])) {
$interest = $order->interest->calculateInterest();
}
$order['interest']['total_amount'] = bcadd($order->interest->total_price, $interest, 2);
return $order;
}