我是 Laravel 的初学者。
我在 Laravel 7 中有一个项目。
我有这个代码:
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();
}
我怎样才能从传统的mysql添加到这个代码“ORDER BY RAND()”?
请帮我
郎朗坤