belongsTo(MerchantAccount::class, 'merchant_id','id'); } public function tag() { return $this->belongsTo(MerchantTags::class, 'tag_id', 'id')->select('id','name'); } public function getPicAttribute($value) { if ($this->merchant_id == 491) { if ($value) { if (!strpos('local-pictures', $value) && !strpos($value, 'x-oss-process')) { return $value . Config('image.watermark'); } else { return $value; } } else { return $value; } }else{ return $value; } } }