<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/8
 * Time: 18:52
 */
namespace Modules\Project\Listeners;

use SMG\Mall\Events\OrderCreatedEvent;

class OrderCreateListener
{
    public function handle(OrderCreatedEvent $event)
    {
        $order = $event->order;
//        if ($order->type != 'default') {
//            return;
//        }
//        $user = $order->user;
//        $parent = $user->invitation ? ($user->invitation->parent ? $user->invitation->parent->user : 0) : null;
//        if ($parent) {
//            $order->parent_id = $parent->id;
//            $order->save();
//        }
    }
}
