0
我想在以下查詢中的'select'(內部查詢)中寫'select'。內部查詢將用於如下計數: select count('id')from order where memb_id = 2;如何在laravel中編寫內部查詢或嵌套查詢
和查詢是:
$payment_pending_report = DB::connection('mysql_freesubs')->table('contact as c')
->select("a.name","c.lname","a.amount as pending amount")
->join("member AS m", "c.id", "=", "m.cont_id")
->join("order AS o", "o.memb_id", "=", "m.id")
->join("account AS a", "c.id", "=", "a.cont_id")
->where("a.amount_type", "=","dr")
->get();
如果你打算爲-1我,至少告訴我爲什麼。 –