我怎样才能在laravel 5.2中申请加入

时间:2017-02-06 10:38:43

标签: php laravel-5.2

如何在laravel 5.2中编写此查询

SELECT institutes.id,institutes.country,degrees.institute_id,degrees.course     
FROM institutes INNER JOIN degrees 
ON  institutes.id=degrees.institute_id 
WHERE degrees.course ='master' AND institutes.country='america'

学院模型

protected $table = 'institutes';

protected $fillable = [
    'user_id','email', 'contact', 'country','about','name','city'

];


public function degree()
{
    return $this->hasMany('App\Degree','institute_id');

}

学位模型

protected $table = 'degrees';

protected $fillable = [
    'institute_id','description', 'course', 'fees','session','education_req'

];

1 个答案:

答案 0 :(得分:0)

您可以通过以下方式执行此操作

<YOUR_CustomListPreference_PACKAGE_NAME.CustomListPreference
        android:defaultValue="X"
        android:dialogTitle="Dialog Title"
        android:entries="@array/list_item_title"
        android:entryValues="@array/list_item_value"
        android:key="pref_list"
        android:summary="%s"
        android:title="@string/Preference Title"
        app:typefaceTitle="YOUR FONT NAME"
        app:typefaceSummary="YOUR FONT NAME"/>