Kirin il y a 4 ans
Parent
commit
6f6985b6dd
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      app/admin/model/system/SystemStoreProductStockLog.php

+ 4 - 0
app/admin/model/system/SystemStoreProductStockLog.php

@@ -63,6 +63,8 @@ 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) {
+            return SystemStoreProductStock::where('id', $stock['id'])->update(['price' => $price]);
         } else {
             return true;
         }
@@ -92,6 +94,8 @@ 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) {
+            return SystemStoreProductStock::where('id', $stock['id'])->update(['price' => $price]);
         } else {
             return true;
         }