1234567891011121314151617181920212223242526 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Goods extends Model
- {
- protected $table='goods';
- protected $guarded=[];
- protected $fillable=['name','vip_price','price','sale_num','content','banner','img','main_attr','is_delete','is_shelves'];
- public function goodSku(){
- return $this->hasMany(GoodSku::class,'goods_id');
- }
- public function getVipPriceAttribute($value){
- return round($value);
- }
- public function getPriceAttribute($value){
- return round($value);
- }
- }
|