初始化仓库

This commit is contained in:
2024-09-19 11:32:39 +08:00
commit 8f5315e936
921 changed files with 76455 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace common\handlers\orderHandler;
use common\core\BaseModel;
use common\events\OrderEvent;
use common\models\Mall;
/**
* @property OrderEvent $event
* @property Mall $mall
*/
abstract class BaseOrderHandler extends BaseModel
{
public $event;
public $mall;
/**
* @return mixed
* 事件处理
*/
abstract public function handle();
/**
* @return $this
*/
public function setMall()
{
try {
$this->mall = \Yii::$app->mall;
} catch (\Exception $exception) {
$mall = Mall::findOne(['id' => $this->event->order->mall_id]);
\Yii::$app->setMall($mall);
$this->mall = \Yii::$app->mall;
}
return $this;
}
}