Bills.php
715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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 . "月账单";
    }
}