belongsTo(User::class,'user_id')->withTrashed(); } public function get_order_detail(){ return $this->hasMany(Orderdetail::class,'order_id','id'); } public function get_address(){ return $this->belongsTo(Address::class,'address_id','id'); } public function get_order_log(){ return $this->hasMany(Orderlog::class,'order_id','id'); } public function get_order_gift() { return $this->belongsToMany('App\Models\Gifts','order_gift','order_id','gift_id')->withPivot('num'); } public function get_order_remark(){ return $this->hasMany(OrderRemark::class,'order_id','id'); } public function get_store(){ return $this->belongsTo(Store::class,'store_id'); } public function get_order_good() { return $this->belongsToMany(Goodtest::class,'order_detail','order_id','goods_id')->withPivot('num'); } public function belong_user(){ return $this->belongsTo(User::class,'good_user_id')->withTrashed(); } }