shish há 3 anos atrás
pai
commit
4ee23e3908
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      biz-ghs/product/classes/ProductClass.php

+ 6 - 0
biz-ghs/product/classes/ProductClass.php

@@ -117,6 +117,12 @@ class ProductClass extends BaseClass
         foreach ($list as $k => $v) {
             $shortCover = $v['cover'] ?? '';
             $list[$k]['cover'] = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_100,w_100";
+
+            $ratio = isset($v['ratio']) && $v['ratio'] > 0 ? $v['ratio'] : 1;
+            $stockInfo = self::formatStock($v['stock'], $ratio);
+            $list[$k]['bigNum'] = $stockInfo['bigNum'];
+            $list[$k]['smallNum'] = $stockInfo['smallNum'];
+
         }
         return $list;
     }