修改利息计算的错误

This commit is contained in:
luofei 2023-07-31 16:24:18 +08:00
parent 996ed2d104
commit dfd22ce55a

View File

@ -27,6 +27,9 @@ class StoreOrderInterest extends BaseModel
*/
public function calculateInterest()
{
if ($this->start_time == '0000-00-00 00:00:00') {
return 0;
}
$days = ceil((time() - strtotime($this->start_time)) / 86400);
$days = max($days ,0);
$money = bcmul($this->total_price, ($this->rate / 100), 3);