<?php
namespace app\common\listener;

use app\api\logic\ActivityLogic;
use app\api\logic\PropertyCommissionLogic;
use think\facade\Log;

/**
 * 优惠券逆向为活动工单+代理订单
 * Class ReverseCouponToActivityListener
 * @package app\listener
 */
class ReverseCouponToActivityListener
{
    public function handle($params)
    {
        try {
            if (empty($params['id'])) {
                throw new \Exception('工单id不能为空');
            }
            ActivityLogic::ReverseCouponToActivity($params);
            return true;
        } catch (\Exception $e) {
            Log::write('优惠券逆向为活动单失败:'.$e->getMessage());
            return $e->getMessage();
        }
    }
}