| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- /**
- * 订单支付后事件
- * Created by PhpStorm.
- * Author: 芸众商城 www.yunzshop.com
- * Date: 2017/3/3
- * Time: 上午11:44
- */
- namespace app\common\events\goods;
- class ActualStockForOrderEvent extends \app\common\events\Event
- {
- protected $goods;
- protected $is_replace;
- protected $actual_stock;
- public function __construct($goods)
- {
- $this->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;
- }
- }
- }
|