uniacid = $uniacid; \YunShop::app()->uniacid = $uniacid; \Setting::$uniqueAccountId = $uniacid; $this->requestData = $requestData; $this->goods = $goods; } public function handle() { \YunShop::app()->uniacid = $this->uniacid; \Setting::$uniqueAccountId = $this->uniacid; \Log::debug(\YunShop::app()->uniacid.'----库存变动--'.$this->goods->id, $this->goods->getDirty()); \Log::debug('---库存变动------', $this->goods->getAttributes()); \Log::debug('---库存变动------', $this->requestData); //有修改退库存 $bool = $this->goods->isDirty('stock'); if ($bool) { \Log::debug('----库存变动--stock'.$bool); } if ($bool) { $event = new GoodsStockChangeEvent($this->goods, $this->requestData); \Log::debug('----库存变动--触发--'.get_class($event)); event($event); } } }