<?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();
|
}
|
|
}
|