whereType($type)->whereStatus(1)->orderBy('sort', 'desc'); } function label() { return $this->hasMany(GoodsLabel::class, 'goods_id', 'id'); } function getPriceAttribute($value) { return $value/100; } function setPriceAttribute($value) { $this->attributes['price'] = $value*100; } function getRenewAttribute($value) { return $value/100; } function setRenewAttribute($value) { return $this->attributes['renew'] = $value*100; } function getTrafficLabelAttribute() { return flowAutoShow($this->attributes['traffic']*1048576); } }