commit | author | age
|
2207d6
|
1 |
<?php |
W |
2 |
/** |
|
3 |
* Created by PhpStorm. |
|
4 |
* User: 风哀伤 |
|
5 |
* Date: 2019/2/14 |
|
6 |
* Time: 16:20 |
|
7 |
* @copyright: ©2019 浙江禾匠信息科技 |
|
8 |
* @link: http://www.zjhejiang.com |
|
9 |
*/ |
|
10 |
|
|
11 |
namespace app\handlers; |
|
12 |
|
|
13 |
|
|
14 |
use app\events\OrderEvent; |
|
15 |
use app\forms\common\order\CommonOrder; |
|
16 |
use app\models\Order; |
|
17 |
|
|
18 |
class OrderSalesHandler extends HandlerBase |
|
19 |
{ |
|
20 |
public function register() |
|
21 |
{ |
|
22 |
\Yii::$app->on(Order::EVENT_SALES, function ($event) { |
|
23 |
/** @var OrderEvent $event */ |
|
24 |
\Yii::$app->setMchId($event->order->mch_id); |
|
25 |
$commonOrder = CommonOrder::getCommonOrder($event->order->sign); |
|
26 |
$orderHandler = $commonOrder->getOrderHandler(); |
|
27 |
$handler = $orderHandler->orderSalesHandlerClass; |
|
28 |
$handler->orderConfig = $commonOrder->getOrderConfig(); |
|
29 |
$handler->event = $event; |
|
30 |
$handler->setMall()->handle(); |
|
31 |
}); |
|
32 |
} |
|
33 |
} |