|
|
|
@ -28,13 +28,22 @@ class Merchant extends BaseModel |
|
|
|
|
// 定义主键 |
|
|
|
|
protected $pk = 'merchant_id'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 关联logo图片 |
|
|
|
|
* @return HasOne |
|
|
|
|
*/ |
|
|
|
|
public function logoImage(): HasOne |
|
|
|
|
{ |
|
|
|
|
return $this->hasOne('UploadFile', 'file_id', 'logo_image_id'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 关联logo图片 |
|
|
|
|
* @return HasOne |
|
|
|
|
*/ |
|
|
|
|
public function logoImage(): HasOne |
|
|
|
|
public function licenseImage(): HasOne |
|
|
|
|
{ |
|
|
|
|
return $this->hasOne('UploadFile', 'file_id', 'logo_image_id'); |
|
|
|
|
return $this->hasOne('UploadFile', 'file_id', 'license_img_id'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -46,7 +55,7 @@ class Merchant extends BaseModel |
|
|
|
|
{ |
|
|
|
|
try { |
|
|
|
|
$list = self::withoutGlobalScope() |
|
|
|
|
->with(['logoImage']) |
|
|
|
|
->with(['logoImage', "licenseImage"]) |
|
|
|
|
->where('merchant_id', '=', $merchantId) |
|
|
|
|
->find(); |
|
|
|
|
return $list ?? null; |
|
|
|
|