<?php

namespace App\Observers;

use App\Owner;

class OwnerObserver
{
    /**
     * 监听插入事件
     *
     * @param Owner $owner
     * @return void
     */
    public function created(Owner $owner)
    {
        app("OwnerAreaReportService")->notExistToInsert([$owner]);
        if(env('APP_ENV')=='production')
            app("OwnerService")->syncPush($owner);
            app("OwnerService")->createAuthority($owner);
    }

    public function updated(Owner $owner)
    {
        if(env('APP_ENV')=='production'){
            app("OwnerService")->syncUpdate($owner);
        }
    }

}
