Bills.php 715 Bytes
<?php


namespace App\Traits;

use App\Models\Legal\Channel;

/**
 * 账单
 * Class Bills
 * @package App\Traits
 */
trait Bills
{

    /**
     * 获取账单名字
     * @param \App\Models\Legal\Bills $bills
     */
    public function billsTitle($bills)
    {
        $start_month = date('m', strtotime($bills->bill_section_start));
        $end_month   = date('m', strtotime($bills->bill_section_end));
        $channel     = Channel::getChannelName()[$bills->channel] ?? '';

        return "{$start_month}-{$end_month}{$channel}版税账单";
    }

    /**
     * @param $month
     * @return string
     */
    public function billsSubTitle($month)
    {
        return $month . "月账单";
    }


}