美文网首页
laravel orm随机排序 --- 2022-07-07

laravel orm随机排序 --- 2022-07-07

作者: 一位先生_ | 来源:发表于2022-07-07 15:01 被阅读0次

->inRandomOrder()

date = Carbon::yesterday()->toDateString();pay_uid_amount_map = Pay::select(['uid', DB::raw("sum(money) as amount")])->where('date', date) ->where('trade_status', 'success')->groupBy('uid');pay_uid_amount_map2 = PayV2::select(['uid', DB::raw("sum(money) as amount")])->where('date', $date)
->where('trade_status', 'success')->groupBy('uid');

    $pay_uid_amount_map = $pay_uid_amount_map2->union($pay_uid_amount_map)->pluck('amount', 'uid');

相关文章

网友评论

      本文标题:laravel orm随机排序 --- 2022-07-07

      本文链接:https://www.haomeiwen.com/subject/sdlpbrtx.html