123456789101112131415161718192021 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class GoodSku extends Model
- {
- use SoftDeletes;
- protected $table='goods_sku';
- protected $fillable=['user_id','goods_id','price','num','amount','size','type','is_true','sort'];
- public function goods(){
- return $this->belongsTo(Goods::class,'goods_id');
- }
- public function getPriceAttribute($value){
- return round($value);
- }
- }
|