我是 Laravel 的初學(xué)者。我在 Laravel 7 中有一個(gè)項(xiàng)目。我有這個(gè)代碼:public function getPromoProducts() { return $this->model->select('name', 'slug', 'products.id', 'small_description', 'promo_desc')->with(['features', 'frontImage'])->active()->leftJoin('selected_product_features', function ($join) { $join->on('products.id', '=', 'selected_product_features.product_id'); })->where('selected_product_features.key', 'price_promo')->where('selected_product_features.description', '<>', 0)->limit(2)->get(); }我怎樣才能從傳統(tǒng)的mysql添加到這個(gè)代碼“ORDER BY RAND()”?請(qǐng)幫我
laravel 相當(dāng)于隨機(jī)排序
翻翻過(guò)去那場(chǎng)雪
2023-08-06 15:30:57