SyncSkuToRedis(); } public function SyncSkuToRedis(){ $order_ids = Order::where('warehouse', 3)->where('is_del', 0)->whereNull('orderCode')->lists('id'); $res = OrderGoodsSkus::select(DB::raw('sum(num) as num , sku_id'))->whereIn('order_id', $order_ids)->where('mj_status', 0)->where('is_del', 0)->groupBy('sku_id')->get(); $res = json_decode(json_encode($res), true); Order::diffSkuToRedis('', $res); } }