quanwei
2025-12-04 12913c1069347ea4b1f6ab87f480da0f8d8c646a
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
<?php
 
namespace app\common\model\plus\release;
use app\common\model\BaseModel;
 
/**
 * 图片模型
 */
class ReleaseProjectImage extends BaseModel
{
    protected $name = 'release_project_image';
    protected $pk = 'id';
    protected $updateTime = false;
 
    /**
     * 关联文件库
     */
    public function file()
    {
        return $this->belongsTo('app\\common\\model\\file\\UploadFile', 'image_id', 'file_id')
            ->bind(['file_path', 'file_name', 'file_url']);
    }
 
    
    public static function getImage($project_id)
    {
        $model = new static;
        return $model->with(['file'])
            ->where('project_id', '=', $project_id)
            ->select();
    }
 
}