打赏

laravel 使用DB链接 leftJoin 查询

1 $product_count = DB::table('fook_platform_orderrefund as a')
2                 ->leftJoin('fook_platform_orderinfo as i','a.orderinfo_id', '=' ,'i.id')
3                 ->whereBetween('a.refund_time',[date('Y-m-d 00:00:00', strtotime("-$i days")), date('Y-m-d 23:59:59', strtotime("-$i days"))])
4                 ->count("a.id");

 

posted on 2018-11-21 18:31  头大的冯冯  阅读(311)  评论(0编辑  收藏  举报

导航