quanwei
2025-10-31 f226d5fe6327e31bb471a96b7370cf94689c6608
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
<?php
 
namespace app\common\model\plus\live;
 
use app\common\model\BaseModel;
 
/**
 * 礼物模型
 */
class Gift extends BaseModel
{
    protected $name = 'live_gift';
    protected $pk = 'gift_id';
 
    /**
     * 关联封面图
     */
    public function image()
    {
        return $this->hasOne('app\\common\\model\\file\\UploadFile', 'file_id', 'image_id')
            ->bind(['file_path', 'file_name', 'file_url']);
    }
 
    /**
     * 详情
     */
    public static function detail($gift_id, $with = [])
    {
        return (new static())->with($with)->find($gift_id);
    }
 
}