소스 검색

欠账的清理

shish 1 년 전
부모
커밋
b12f86a91c
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      biz-mall/order/classes/OrderClass.php

+ 13 - 0
biz-mall/order/classes/OrderClass.php

@@ -62,6 +62,19 @@ class OrderClass extends BaseClass
     public static function getDebtList($where)
     public static function getDebtList($where)
     {
     {
         $list = self::getAllList('*', $where, 'addTime DESC');
         $list = self::getAllList('*', $where, 'addTime DESC');
+
+        if (!empty($list)) {
+            foreach ($list as $key => $value) {
+                $debtPrice = $value['debtPrice'] ?? 0;
+                $remainDebtPrice = $value['remainDebtPrice'] ?? 0;
+                $hasPayDebt = 0;
+                if ($debtPrice > $remainDebtPrice) {
+                    $hasPayDebt = bcsub($debtPrice, $remainDebtPrice, 2);
+                }
+                $list[$key]['hasPayDebt'] = floatval($hasPayDebt);
+            }
+        }
+
         $count = self::getCount($where);
         $count = self::getCount($where);
         return ['list' => $list, 'debtNum' => $count];
         return ['list' => $list, 'debtNum' => $count];
     }
     }