quanwei
2025-11-15 6f12eadd25c8f5335fd9eccf373bf9835bf3e4c6
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
40
41
42
43
44
45
<?php
 
namespace app\common\model\plus\live;
 
use app\common\model\BaseModel;
 
/**
 * 微信直播模型
 */
class WxLive extends BaseModel
{
    protected $name = 'app_wx_live';
    protected $pk = 'live_id';
    //附加字段
    protected $append = ['start_time_text','end_time_text'];
 
    /**
     * 有效期-开始时间
     * @param $value
     * @return array
     */
    public function getStartTimeTextAttr($value, $data)
    {
        return date('Y-m-d H:i:s', $data['start_time']);
    }
 
    /**
     * 有效期-开始时间
     * @param $value
     * @return array
     */
    public function getEndTimeTextAttr($value, $data)
    {
        return date('Y-m-d H:i:s', $data['end_time']);
    }
 
    /**
     * 详情
     */
    public static function detail($live_id)
    {
        return (new static())->find($live_id);
    }
 
}