setTable(DB::raw($model->getTable() . ' ' . $index_raw)); return $model; } protected function user() { return $this->hasOne(User::class, 'id', 'uid'); } protected function book_config() { return $this->hasOne(BookConfig::class, 'bid', 'from_bid'); } protected function activity() { return $this->hasOne(Activity::class, 'id', 'activity_id'); } protected function send_order() { return $this->hasOne(SendOrder::class, 'id', 'send_order_id'); } }