多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
【Laravel Join table】 简单方法: ``` use Illuminate\Support\Facades\DB; $result = DB::table('users') ->join('posts', 'users.tag_id', '=', 'posts.tag') ->select('*') // ->first(); ->limit(1); var_dump($result); ``` ``` // 多对一 public function thumbnail_video() { return $this->belongsTo('App\Thumbnail_video', 'number_id', 'number'); } ``` ``` $media = Media::first(); echo $media->id; echo '<hr/>'; echo $media->thumbnail_video->id; ``` 参考: https://laravel.com/docs/5.5/queries