$val){ $foot_where = []; $foot_where[] = ['pipe_type', '=', 'video']; $foot_where[] = ['pipe_id', '=', $val['id']]; $alltime = Footprints::where($foot_where)->sum('visit_due_time'); if(!empty($alltime)) $all[] = ['id'=>$val['id'],'visit_due_time'=>$alltime]; } $mod = new Video; $mod->saveAll($all); } } ?>