goods = $goods; $this->actual_stock = 0; $this->is_replace = 0; } public function getGoods() { return $this->goods; } public function setActualStock($stock, $msg = '') { $this->actual_stock = $stock; $this->is_replace = 1; \Log::debug('插件设置当前实际库存:' . $msg, $stock); } public function getReplaceStock() { if ($this->is_replace) { return $this->actual_stock; } else { return false; } } }