我有兩個表Parameters
和Share_Details
。我在這裡有我的原始SQL查詢,我想以純粹的Eloquent方式編寫它。請幫忙。
$shareDetails=DB::select ("SELECT s.id, share_type, para_int_1, para_int_2, price, para_name FROM share_details as s,parameters where para_type='share' and para_id=share_type and startDate=(select max(startdate) from share_details where share_type=s.share_type) group by share_type, s.id, para_int_1, para_int_2, price, para_name");
嘗試像這樣: