比方說,我有這2種型號: 訂貨型號: ID 狀態(未完成,完成) 項目型號: ID ORDER_ID 類型 is_worthy。 。 /**
* Returns the item's price according to its worthy
*/
public function getPriceAttribute()
{
return $this->is_worthy ? 10
我有問題!這是我的代碼: public static function getMessages($threader_id){
$messages = DB::table('messages_messages')
->join('messages_participants', function ($join) {
$join->on('messages_pa
我怎樣寫這Laravel查詢生成器: 我有了一個客戶與'phone'列用戶表。 一個客戶屬於用戶上'user_id'與'mobile列」表。 我想找一個電話號碼是'手機'或'手機'的任何客戶ID。事情是這樣的: select id
from customers
where mobile = '5555555555' or
user_id = (select id
from us