Browse Source

一些功能

Kirin 4 years ago
parent
commit
ca75a34d52
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/admin/model/system/SystemStoreProductStockLog.php

+ 2 - 2
app/admin/model/system/SystemStoreProductStockLog.php

@@ -63,7 +63,7 @@ class SystemStoreProductStockLog extends BaseModel
             $add_time = time();
             $stock_id = $stock['id'];
             return self::create(compact('stock_id', 'link_id', 'type', 'number', 'balance', 'mark', 'status', 'pm', 'add_time', 'adder_id'));
-        } else if ($price > 0) {
+        } else if ($price != $stock['price']) {
             return SystemStoreProductStock::where('id', $stock['id'])->update(['price' => $price]);
         } else {
             return true;
@@ -94,7 +94,7 @@ class SystemStoreProductStockLog extends BaseModel
             $add_time = time();
             $stock_id = $stock['id'];
             return self::create(compact('stock_id', 'link_id', 'type', 'number', 'balance', 'mark', 'status', 'pm', 'add_time', 'adder_id'));
-        } else if ($price > 0) {
+        } else if ($price != $stock['price']) {
             return SystemStoreProductStock::where('id', $stock['id'])->update(['price' => $price]);
         } else {
             return true;