Jelajahi Sumber

提现限制

Kirin 1 tahun lalu
induk
melakukan
ff4d0a1e31
1 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 4 4
      app/models/system/SystemStoreStock.php

+ 4 - 4
app/models/system/SystemStoreStock.php

@@ -104,18 +104,18 @@ class SystemStoreStock extends BaseModel
             $info = self::where(['store_id' => $store_id, 'product_id' => $data['product_id'], 'bar_code' => $data['bar_code']])->find();
             $info = self::where(['store_id' => $store_id, 'product_id' => $data['product_id'], 'bar_code' => $data['bar_code']])->find();
             if ($info) {
             if ($info) {
                 if ($data['type'] == 1) {
                 if ($data['type'] == 1) {
-                    $add = bcsub($data['in_stock'], $info['repair_sales']);
+                    $add = bcsub($data['in_stock'], $info['repair_sales'], 3);
                     if ($add > 0) {
                     if ($add > 0) {
-                        self::where(['store_id' => $store_id, 'product_id' => $data['product_id'], 'bar_code' => $data['bar_code']])->update(['in_stock' => bcadd($info['in_stock'], $add), 'repair_sales' => 0]);
+                        self::where(['store_id' => $store_id, 'product_id' => $data['product_id'], 'bar_code' => $data['bar_code']])->update(['in_stock' => bcadd($info['in_stock'], $add, 3), 'repair_sales' => 0]);
                     } else {
                     } else {
-                        self::where(['store_id' => $store_id, 'product_id' => $data['product_id'], 'bar_code' => $data['bar_code']])->update(['repair_sales' => bcsub($info['repair_sales'], $data['in_stock'])]);
+                        self::where(['store_id' => $store_id, 'product_id' => $data['product_id'], 'bar_code' => $data['bar_code']])->update(['repair_sales' => bcsub($info['repair_sales'], $data['in_stock'], 3)]);
                     }
                     }
                     @file_put_contents("stock.txt", self::getlastsql());
                     @file_put_contents("stock.txt", self::getlastsql());
                 } else {
                 } else {
                     if ($info['in_stock'] < $data['in_stock']) {
                     if ($info['in_stock'] < $data['in_stock']) {
                         return self::setErrorInfo('库存不足');
                         return self::setErrorInfo('库存不足');
                     }
                     }
-                    self::where(['store_id' => $store_id, 'product_id' => $data['product_id'], 'bar_code' => $data['bar_code']])->update(['in_stock' => bcsub($info['in_stock'], $data['in_stock'])]);
+                    self::where(['store_id' => $store_id, 'product_id' => $data['product_id'], 'bar_code' => $data['bar_code']])->update(['in_stock' => bcsub($info['in_stock'], $data['in_stock'], 3)]);
                     @file_put_contents("stock.txt", self::getlastsql());
                     @file_put_contents("stock.txt", self::getlastsql());
                 }
                 }
                 return true;
                 return true;