<?php

namespace app\model;

use think\Collection;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;

/**
 * 优惠券验证记录  各个角色的提成
 * Class Coupon
 * @package app\model
 */
class CouponBill extends Base
{
    public const  agency_money = "agency_money";
    public const  admin_money = "admin_money";
    public const  consumer_money = "consumer_money";
    public function couponMain()
    {
        return $this->hasOne(CouponMain::class, 'id',"coupon_main_id");
    }

    public function business()
    {
        return $this->hasOne(Business::class, 'code',"business_code");
    }
    public function account()
    {
        return $this->hasOne(Account::class, 'user_code',"user_code");
    }
}